DayZ 1.30
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
41 animSource = car.GetAnimSourceFromSelection(car.GetDoorSelectionNameFromSeatPos(crewIdx));
42
44 if (!car.CanReachDoorsFromSeat(animSource, crewIdx) || !car.IsAreaAtDoorFreeDiag(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:147
override int GetCarDoorsState(string slotType)
Определения Truck_02.c:106
override string GetAnimSourceFromSelection(string selection)
Определения Truck_02.c:205
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения Truck_02.c:264

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