DayZ 1.24
Loading...
Searching...
No Matches
CASingleUseQuantity.c
Go to the documentation of this file.
2{
3 protected float m_QuantityUsedPerAction;
4 protected float m_ItemQuantity;
6
11
13 {
14 if (!m_SpentUnits)
16 else
17 m_SpentUnits.param1 = 0;
18 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
19 }
20
22 {
23 if (!action_data.m_Player)
24 return UA_ERROR;
25
26
28 return UA_FINISHED;
29 }
30
31 //---------------------------------------------------------------------------
32
34 {
35 if (GetGame().IsServer())
36 {
37 if (m_SpentUnits)
38 {
41 }
42
43 action_data.m_MainItem.AddQuantity(- m_QuantityUsedPerAction, false, false);
44 }
45 }
46};
void CalcAndSetQuantity()
void SetACData(Param units)
Definition CABase.c:38
void CalcAndSetQuantity(ActionData action_data)
void CASingleUseQuantity(float quantity_used_per_action)
override void Setup(ActionData action_data)
ref Param1< float > m_SpentUnits
override int Execute(ActionData action_data)
proto native CGame GetGame()
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455