DayZ 1.24
Loading...
Searching...
No Matches
ActionAnimateSeats Class Reference
Inheritance diagram for ActionAnimateSeats:
[legend]
Collaboration diagram for ActionAnimateSeats:
[legend]

Private Member Functions

void ActionAnimateSeats ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedInVehicle ()
 

Detailed Description

Definition at line 1 of file ActionAnimateSeats.c.

Constructor & Destructor Documentation

◆ ActionAnimateSeats()

void ActionAnimateSeats::ActionAnimateSeats ( )
inlineprivate

Definition at line 3 of file ActionAnimateSeats.c.

4 {
5 m_Text = "#move_seat";
6 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionAnimateSeats::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 8 of file ActionAnimateSeats.c.

9 {
10 if (!target) return false;
11 if (!IsInReach(player, target, UAMaxDistances.DEFAULT)) return false;
12
13 Object targetObject = target.GetObject();
17 int crewIdx;
18
19 //string selection = targetObject.GetActionComponentName(target.GetComponentIndex());
21 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
22
23
25 return false;
26
28 {
29 for (int i = 0; i < selections.Count(); i++)
30 {
31 m_AnimSource = car.GetAnimSourceFromSelection(selections[i]) ;
32 if (m_AnimSource != "")
33 {
34 //return true; //TODO:: NEED A LINK BETWEEN SeatBack and seat with crew after that we can REMOVE the return
35
36 HumanCommandVehicle vehCmd = player.GetCommand_Vehicle();
37
38 if (m_AnimSource == "SeatDriver")
39 {
40 if (transport.CrewMember(DayZPlayerConstants.VEHICLESEAT_DRIVER))
41 return false;
42
43 if (!vehCmd && car.GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
44 return false;
45 }
46
47 if (m_AnimSource == "SeatCoDriver")
48 {
49 if (transport.CrewMember(DayZPlayerConstants.VEHICLESEAT_CODRIVER))
50 return false;
51
52 if (!vehCmd && car.GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
53 return false;
54 }
55
56 if (!vehCmd && !transport.CanReachSeatFromDoors(selections[i], player.GetPosition(), 1.0))
57 return false;
58
59 return true;
60 }
61 }
62 }
63
64 return false;
65 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
CarDoorState
Definition CarScript.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Camera.c:2
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), UAMaxDistances::DEFAULT, IsInReach(), and ActionAnimateCarSelection::m_AnimSource.

◆ CanBeUsedInVehicle()

override bool ActionAnimateSeats::CanBeUsedInVehicle ( )
inlineprivate

Definition at line 67 of file ActionAnimateSeats.c.

68 {
69 return true;
70 }

The documentation for this class was generated from the following file: