Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionattachonproxy.c
Go to the documentation of this file.
2 {
4  {
5  m_Text = "#attach";
6  }
7 
8  override void CreateConditionComponents()
9  {
12  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ATTACHITEM;
13  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
14  }
15 
16  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
17  {
18  Object targetObject = target.GetObject();
19  Object targetParent = target.GetParent();
20  EntityAI target_entity = EntityAI.Cast( targetParent );
21  EntityAI item_entity = item;
22 
23  if ( targetParent )
24  {
25  if ( target_entity && item_entity )
26  {
27  if ( target_entity.GetInventory() && target_entity.GetInventory().CanAddAttachment( item_entity ) )
28  {
29  return true;
30  }
31  }
32  }
33 
34  return false;
35  }
36 
37  override void OnExecuteClient( ActionData action_data )
38  {
39  super.OnExecuteClient( action_data );
40 
41  if ( action_data.m_Player.IsPlacingLocal() )
42  {
43  action_data.m_Player.TogglePlacingLocal();
44  }
45  }
46 }
ItemBase
Definition: inventoryitem.c:730
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
Object
Definition: objecttyped.c:1
CCTCursor
Definition: cctcursor.c:1
ActionAttach
ActionAttachWheels ActionAttach
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionAttachOnProxy
Definition: actionattachonproxy.c:1
EntityAI
Definition: building.c:5