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

◆ ActionCondition()

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

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

40 {
41 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
42 return false;
43
44 Object targetObject = target.GetObject();
45 Object targetParent = target.GetParent();
46 CarDoor carDoor = CarDoor.Cast(targetObject);
47
48 if (!carDoor || !player)
49 return false;
50
51 if (GetGame().IsMultiplayer() && GetGame().IsServer())
52 return true;
53
54 if (carDoor)
55 {
56 //Check if item is attached to car -> If so, block repair if door is closed
57 if (targetParent != null)
58 {
59 InventoryLocation loc = new InventoryLocation();
60 bool isPresent = carDoor.GetInventory().GetCurrentInventoryLocation(loc);
61
62 if (!isPresent || loc.GetSlot() == -1)
63 return false;
64
65 string slotName = InventorySlots.GetSlotName(loc.GetSlot());
66 if (slotName && CarScript.Cast(targetParent).GetCarDoorsState(slotName) != CarDoorState.DOORS_OPEN)
67 return false;
68 }
69
70 //Check health level of door
71 int zoneHP = carDoor.GetHealthLevel("");
72 return zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED);
73 }
74
75 return false;
76 }
CarDoorState
Определения CarScript.c:2
void CarScript()
Определения CarScript.c:280
PlayerSpawnPreset slotName
eBrokenLegs
Определения EBrokenLegs.c:2
proto native int GetSlot()
returns slot id if current type is Attachment
class LOD Object
proto native CGame GetGame()

Перекрестные ссылки ActionTarget, CarScript::GetCarDoorsState(), GetGame(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), slotName, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.