Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
casingleusequantityedible.c
Go to the documentation of this file.
2 {
3  void CASingleUseQuantityEdible( float quantity_used_per_action )
4  {
5  m_QuantityUsedPerAction = quantity_used_per_action;
6  }
7 
8  override void CalcAndSetQuantity(ActionData action_data )
9  {
10  if ( m_SpentUnits )
11  {
12  m_SpentUnits.param1 = m_QuantityUsedPerAction;
13  SetACData(m_SpentUnits);
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  }
34 };
GetGame
proto native CGame GetGame()
CASingleUseQuantityEdible
Definition: casingleusequantityedible.c:1
CASingleUseQuantity
Definition: casingleusequantity.c:1
EConsumeType
EConsumeType
Definition: econsumetype.c:1
PlayerBase
Definition: playerbaseclient.c:1
ActionData
Definition: actionbase.c:20