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

Private Member Functions

void CASingleUseQuantityEdible (float quantity_used_per_action)
 
override void CalcAndSetQuantity (ActionData action_data)
 
- Private Member Functions inherited from CASingleUseQuantity
void CASingleUseQuantity (float quantity_used_per_action)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
void CalcAndSetQuantity (ActionData action_data)
 

Additional Inherited Members

- Private Attributes inherited from CASingleUseQuantity
float m_QuantityUsedPerAction
 
float m_ItemQuantity
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CASingleUseQuantityEdible.c.

Constructor & Destructor Documentation

◆ CASingleUseQuantityEdible()

void CASingleUseQuantityEdible::CASingleUseQuantityEdible ( float quantity_used_per_action)
inlineprivate

Member Function Documentation

◆ CalcAndSetQuantity()

override void CASingleUseQuantityEdible::CalcAndSetQuantity ( ActionData action_data)
inlineprivate

Definition at line 8 of file CASingleUseQuantityEdible.c.

9 {
10 if (m_SpentUnits)
11 {
14 }
15
16 PlayerBase ntarget = PlayerBase.Cast(action_data.m_Target.GetObject());
17 if (ntarget)
18 {
19 if (GetGame().IsServer())
20 {
21 //action_data.m_MainItem.Consume(ntarget, m_QuantityUsedPerAction);
22 ntarget.Consume(action_data.m_MainItem, m_QuantityUsedPerAction, EConsumeType.ITEM_SINGLE_TIME);
23 }
24 }
25 else
26 {
27 if (GetGame().IsServer())
28 {
29 //action_data.m_MainItem.Consume(action_data.m_Player, m_QuantityUsedPerAction);
30 action_data.m_Player.Consume(action_data.m_MainItem, m_QuantityUsedPerAction, EConsumeType.ITEM_SINGLE_TIME);
31 }
32 }
33 }
EConsumeType
Definition EConsumeType.c:2
void SetACData(Param units)
Definition CABase.c:38
ref Param1< float > m_SpentUnits
proto native CGame GetGame()

References GetGame(), CASingleUseQuantity::m_QuantityUsedPerAction, CASingleUseQuantity::m_SpentUnits, and CABase::SetACData().


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