DayZ 1.28
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 > car.CrewSize() || 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
49 int safeCrewIdx = crewIdx % 4;
51
52 float animationPhaseInside = car.GetAnimationPhase(animSource);
53 return (m_IsOpening && animationPhaseInside <= 0.5) || (!m_IsOpening && animationPhaseInside > 0.5);
54 }
55 }
56
57 return false;
58 }
CarDoorState
Определения CarScript.c:2
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:241
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:262
override int GetCarDoorsState(string slotType)
Определения CivilianSedan.c:164
override string GetAnimSourceFromSelection(string selection)
Определения CivilianSedan.c:328
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения CivilianSedan.c:379

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