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

◆ ActionCondition()

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

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

54 {
55 if ( !target )
56 return false;
57
58 EntityAI parent_EAI = EntityAI.Cast(target.GetParent());
59 ItemBase target_IB = ItemBase.Cast(target.GetObject());
60
61 array<int> compLock = item.m_CompatibleLocks;
62 int targetType = eLockTypes.NONE;
63
64 if ( target_IB && parent_EAI )
65 {
66 //CAR DOOR HANDLING
67 //I don't really like this, but sometimes specifics have to be handled in generics
68 CarDoor targetDoor = CarDoor.Cast(target_IB);
69 if ( targetDoor )
70 {
71 InventoryLocation loc = new InventoryLocation();
72 bool isPresent = targetDoor.GetInventory().GetCurrentInventoryLocation( loc );
73
74 if ( !isPresent || loc.GetSlot() == -1 )
75 return false;
76
77 string slotName = InventorySlots.GetSlotName( loc.GetSlot() );
78 if ( slotName && CarScript.Cast( parent_EAI ).GetCarDoorsState( slotName ) != CarDoorState.DOORS_OPEN )
79 return false;
80 }
81 //END OF CAR DOOR SPECIFICS
82
83
84 if ( target_IB.IsLockedInSlot() )
86 else if ( target_IB.IsAlive() )
88 else if ( !target_IB.IsLockedInSlot() )
89 return false;
90
91 targetType = target_IB.GetLockType();
92
93 for (int i = 0; i < compLock.Count(); i++)
94 {
95 if ( targetType == compLock[i] && targetType != eLockTypes.NONE)
96 {
97 return true;
98 }
99 }
100 }
101 return false;
102 }
class LogManager EntityAI
eLockTypes
Определения ActionLockAttachment.c:4
CarDoorState
Определения CarScript.c:2
void CarScript()
Определения CarScript.c:280
PlayerSpawnPreset slotName
class GP5GasMask extends MaskBase ItemBase
const string UNLOCK_VERSION
Определения ActionLockAttachment.c:23
string m_Name
Определения ActionLockAttachment.c:24
const string LOCK_VERSION
Определения ActionLockAttachment.c:22
proto native int GetSlot()
returns slot id if current type is Attachment

Перекрестные ссылки ActionTarget, CarScript::GetCarDoorsState(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), LOCK_VERSION, m_Name, slotName и UNLOCK_VERSION.