DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CanRepair()

bool PluginBase::CanRepair ( ItemBase repair_kit,
Object item,
string damage_zone = "" )
inlineprivate

См. определение в файле PluginRepairing.c строка 92

93 {
94 int state = item.GetHealthLevel(damage_zone);
95
96 if (state != GameConstants.STATE_RUINED && (item.CanBeRepairedToPristine() && state >= GameConstants.STATE_WORN) || (!item.CanBeRepairedToPristine() && state >= GameConstants.STATE_DAMAGED))
97 {
98 int repair_kit_type = repair_kit.ConfigGetInt("repairKitType");
99 if (!repair_kit_type) //outside of regular repair kit logic for some reason, bypass check
100 {
101 return true;
102 }
103
104 array<int> repairable_with_types = new array<int>;
105 item.ConfigGetIntArray("repairableWithKits", repairable_with_types);
106
107 for (int i = 0; i < repairable_with_types.Count(); i++)
108 {
109 int repairable_with_type = repairable_with_types.Get(i);
110
111 if (IsRepairValid(repair_kit_type, repairable_with_type))
112 {
113 return true;
114 }
115 }
116 }
117 return false;
118
119 }
bool IsRepairValid(int repair_kit_type, int repairable_with_type)
Определения PluginRepairing.c:121

Перекрестные ссылки IsRepairValid(), GameConstants::STATE_DAMAGED, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.