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

◆ ActionCondition()

override bool ActionUnlockDoors::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

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

29 {
30 if( !IsBuilding(target) ) return false;
31 if( !IsInReach(player, target, UAMaxDistances.DEFAULT) ) return false;
32
33 Building building;
34 ToolBase tool;
35 if (Class.CastTo(building, target.GetObject())&& Class.CastTo(tool, item))
36 {
37 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
38 if (doorIndex != -1 && tool.GetKeyCompatibilityType() & building.GetLockCompatibilityType(doorIndex))
39 return building.IsDoorLocked(doorIndex);
40 }
41 return false;
42 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Определения ActionBase.c:1181
bool IsBuilding(ActionTarget target)
Определения ActionBase.c:1171
int GetLockCompatibilityType(int doorIdx)
Which door is compatible with which key (door idx supplied). Bitwise.
proto native bool IsDoorLocked(int index)
When the door is locked.
proto native int GetDoorIndex(int componentIndex)
Gets the index of the door based on the view geometry component index.

Перекрестные ссылки ActionTarget, Class::CastTo(), UAMaxDistances::DEFAULT, Building::GetDoorIndex(), Building::GetLockCompatibilityType(), ActionBase::IsBuilding(), Building::IsDoorLocked() и ActionBase::IsInReach().