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

◆ ActionCondition()

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

player inside vehicle

crewIdx sanity checks and see if there is a door

see if door is in reach

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

24 {
25 CarScript car = null;
26 string animSource = "";
27
29 if (player && player.GetCommand_Vehicle())
30 {
31 if (Class.CastTo(car, player.GetCommand_Vehicle().GetTransport()))
32 {
33 int crewIdx = car.CrewMemberIndex(player);
34
36 if (crewIdx < 0 || crewIdx > 3 || car.GetCarDoorsState(car.GetDoorInvSlotNameFromSeatPos(crewIdx)) == CarDoorState.DOORS_MISSING)
37 {
38 return false;
39 }
40
42
44 if (!car.CanReachDoorsFromSeat(animSource, crewIdx) || !car.IsAreaAtDoorFree(crewIdx))
45 {
46 return false;
47 }
48
50
51 float animationPhaseInside = car.GetAnimationPhase(animSource);
52 return (m_IsOpening && animationPhaseInside <= 0.5) || (!m_IsOpening && animationPhaseInside > 0.5);
53 }
54 }
55
56 return false;
57 }
CarDoorState
Определения CarScript.c:2
void CarScript()
Определения CarScript.c:280
bool m_IsOpening
Определения ActionCarDoors.c:4
int m_CommandUIDPerCrewIdx[4]
Определения ActionCarDoors.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
override string GetDoorSelectionNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:240
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:261
override int GetCarDoorsState(string slotType)
Определения CivilianSedan.c:163
override string GetAnimSourceFromSelection(string selection)
Определения CivilianSedan.c:327
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения CivilianSedan.c:378

Перекрестные ссылки ActionTarget, CarScript::CanReachDoorsFromSeat(), Class::CastTo(), CarScript::GetAnimSourceFromSelection(), CarScript::GetCarDoorsState(), CarScript::GetDoorInvSlotNameFromSeatPos(), CarScript::GetDoorSelectionNameFromSeatPos(), AnimatedActionBase::m_CommandUID, m_CommandUIDPerCrewIdx и m_IsOpening.