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

◆ ActionCondition()

override bool ActionRepairMotorbikePart::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

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

36 {
37 Object targetObject = target.GetObject();
38 Object targetParent = target.GetParent();
39 MotorbikePart motorbikePart = MotorbikePart.Cast(targetObject);
40
41 if (!motorbikePart || !player)
42 return false;
43
44 if (g_Game.IsMultiplayer() && g_Game.IsServer())
45 return true;
46
47 if (motorbikePart)
48 {
49 if (targetParent != null)
50 {
51 InventoryLocation loc = new InventoryLocation();
52 bool isPresent = motorbikePart.GetInventory().GetCurrentInventoryLocation(loc);
53
54 if (!isPresent || loc.GetSlot() == -1)
55 return false;
56 }
57
58 int zoneHP = motorbikePart.GetHealthLevel("");
59 return zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED;
60 }
61
62 return false;
63 }
DayZGame g_Game
Определения DayZGame.c:4074
proto native int GetSlot()
returns slot id if current type is Attachment
class LOD Object

Перекрестные ссылки ActionTarget(), g_Game, InventoryLocation::GetSlot(), GameConstants::STATE_RUINED и GameConstants::STATE_WORN.