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

Private Member Functions

void ActionFillFuel ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Private Attributes

const string FUEL_SELECTION_NAME = "refill"
 

Detailed Description

Definition at line 11 of file ActionFillFuel.c.

Constructor & Destructor Documentation

◆ ActionFillFuel()

void ActionFillFuel::ActionFillFuel ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 32 of file ActionFillFuel.c.

33 {
34 if (!target || !IsTransport(target))
35 return false;
36
37 if (item.GetQuantity() <= 0)
38 return false;
39
40 if (item.GetLiquidType() != LIQUID_GASOLINE)
41 return false;
42
43 Car car = Car.Cast(target.GetObject());
44 if (!car)
45 return false;
46
47 if (car.IsDamageDestroyed())
48 return false;
49
50 if (car.GetFluidFraction(CarFluid.FUEL) >= 0.98)
51 return false;
52
54 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
55
57
58 if (carS)
59 {
60 for (int s = 0; s < selections.Count(); s++)
61 {
62 if (selections[s] == carS.GetActionCompNameFuel())
63 {
64 float dist = vector.DistanceSq(carS.GetRefillPointPosWS(), player.GetPosition());
65
66 if (dist < carS.GetActionDistanceFuel() * carS.GetActionDistanceFuel())
67 return true;
68 }
69 }
70 }
71
72 return false;
73 }
bool IsTransport(ActionTarget target)
Definition ActionBase.c:851
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:18
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
const int LIQUID_GASOLINE
Definition constants.c:508

References vector::DistanceSq(), IsTransport(), and LIQUID_GASOLINE.

◆ CreateConditionComponents()

override void ActionFillFuel::CreateConditionComponents ( )
inlineprivate

Definition at line 26 of file ActionFillFuel.c.

27 {
28 m_ConditionItem = new CCINonRuined;//CCINotRuinedAndEmpty?
30 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

Member Data Documentation

◆ FUEL_SELECTION_NAME

const string ActionFillFuel::FUEL_SELECTION_NAME = "refill"
private

Definition at line 13 of file ActionFillFuel.c.


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