Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionattachonproxy.c
Go to the documentation of this file.
1class ActionAttachOnProxy: ActionAttach
2{
4 {
5 m_Text = "#attach";
6 }
7
8 override void CreateConditionComponents()
9 {
10 m_ConditionItem = new CCINonRuined;
11 m_ConditionTarget = new CCTCursor;
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}
int m_CommandUID
Definition actionbase.c:31
int m_StanceMask
Definition actionbase.c:33
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602