DayZ 1.24
Loading...
Searching...
No Matches
ActionAttachOnProxy.c
Go to the documentation of this file.
1class ActionAttachOnProxy: ActionAttach
2{
4 {
5 m_Text = "#attach";
6 }
7
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();
22
23 if (targetParent)
24 {
26 {
27 if (target_entity.GetInventory() && target_entity.GetInventory().CanAddAttachment(item_entity))
28 return true;
29 }
30 }
31
32 return false;
33 }
34
36 {
37 super.OnExecuteClient(action_data);
38
39 if (action_data.m_Player.IsPlacingLocal())
40 action_data.m_Player.TogglePlacingLocal();
41 }
42}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteClient(ActionData action_data)
override void CreateConditionComponents()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597