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

◆ ActionCondition()

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

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

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

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