10 override void CreateConditionComponents()
16 override bool HasProneException()
24 EntityAI attachment = construction_action_data.GetActualAttachmentToDetach();
28 m_Text =
"#take " + attachment.GetDisplayName();
32 override typename GetInputType()
37 override bool HasProgress()
45 if ( target_entity && target_entity.CanUseConstruction() )
48 if(!base_building.IsPlayerInside(player,
""))
52 string main_part_name = target_entity.GetActionComponentName( target.GetComponentIndex() );
57 construction_action_data.RefreshAttachmentsToDetach( target_entity, main_part_name );
59 EntityAI attachment = construction_action_data.GetActualAttachmentToDetach();
61 if ( attachment && player.GetInventory().CanAddEntityIntoHands( attachment ) && attachment.GetHierarchyRootPlayer() != player )
70 override bool CanContinue(
ActionData action_data )
75 override void OnExecuteClient(
ActionData action_data )
77 OnExecuteImpl(action_data);
80 protected void OnExecuteImpl(
ActionData action_data )
83 ItemBase item_target =
ItemBase.Cast( construction_action_data.GetActualAttachmentToDetach() );
86 float stackable = item_target.GetTargetQuantityMax();
88 if( stackable == 0 || stackable >= item_target.GetQuantity() )
91 action_data.m_Player.PredictiveTakeEntityToHands( item_target );
93 else if( stackable != 0 && stackable < item_target.GetQuantity() )
96 item_target.SplitIntoStackMaxHandsClient( action_data.m_Player );
101 override void OnExecuteServer(
ActionData action_data )
106 OnExecuteImpl(action_data);
109 override void CreateAndSetupActionCallback(
ActionData action_data )
112 EntityAI target = construction_action_data.GetActualAttachmentToDetach();
114 bool heavy_item =
false;
116 if ( target && target.ConfigIsExisting(
"heavyItem") && target.ConfigGetBool(
"heavyItem") )
129 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(
DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS,GetCallbackClassTypename()));
136 callback.SetActionData(action_data);
137 callback.InitActionComponent();
138 action_data.m_Callback = callback;