DayZ 1.24
Loading...
Searching...
No Matches
ActionCarHornBase Class Reference

Static Protected Member Functions

static bool PlayerIsDriver (Transport trans, PlayerBase player)
 
static bool BatteryIsVital (ItemBase battery)
 

Static Private Member Functions

static bool ActionCondition (PlayerBase player)
 
static void SetCarHornState (CarHornActionData pActionData, int pState)
 

Detailed Description

Definition at line 1 of file ActionCarHorn.c.

Member Function Documentation

◆ ActionCondition()

static bool ActionCarHornBase::ActionCondition ( PlayerBase player)
inlinestaticprivate

Definition at line 3 of file ActionCarHorn.c.

4 {
5 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
6
7 if (vehCommand)
8 {
9 Transport trans = vehCommand.GetTransport();
10 if (trans)
11 {
13 return false;
14
16 if (Class.CastTo(car, trans))
17 return BatteryIsVital(car.GetBattery());
18 }
19 }
20
21 return false;
22 }
static bool PlayerIsDriver(Transport trans, PlayerBase player)
static bool BatteryIsVital(ItemBase battery)
Super root of all classes in Enforce script.
Definition EnScript.c:11
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References BatteryIsVital(), Class::CastTo(), and PlayerIsDriver().

Referenced by ActionCondition(), and ActionCarHornLong::ActionCondition().

◆ BatteryIsVital()

static bool ActionCarHornBase::BatteryIsVital ( ItemBase battery)
inlinestaticprotected

Definition at line 40 of file ActionCarHorn.c.

41 {
42 return battery && battery.GetHealthLevel("Health") <= GameConstants.STATE_DAMAGED;
43 }
const int STATE_DAMAGED
Definition constants.c:759

References GameConstants::STATE_DAMAGED.

Referenced by ActionCondition().

◆ PlayerIsDriver()

static bool ActionCarHornBase::PlayerIsDriver ( Transport trans,
PlayerBase player )
inlinestaticprotected

Definition at line 35 of file ActionCarHorn.c.

36 {
37 return trans.GetSeatAnimationType(trans.CrewMemberIndex(player)) == DayZPlayerConstants.VEHICLESEAT_DRIVER;
38 }
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionCondition().

◆ SetCarHornState()

static void ActionCarHornBase::SetCarHornState ( CarHornActionData pActionData,
int pState )
inlinestaticprivate

Definition at line 24 of file ActionCarHorn.c.

25 {
26 if (!pActionData.m_Player)
27 return;
28
29 if (!pActionData.m_Car)
30 return;
31
32 pActionData.m_Car.SetCarHornState(pState);
33 }

Referenced by OnEndInput(), ActionCarHornLong::OnEndInput(), OnEndServer(), ActionCarHornLong::OnEndServer(), OnStartServer(), and ActionCarHornLong::OnStartServer().


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