4 string m_ItemName =
"";
13 override void CreateConditionComponents()
19 override bool HasProneException()
24 override bool ActionConditionContinue(
ActionData action_data )
33 if ( tgt_entity &&
BaseBuildingBase.Cast(tgt_entity) &&!tgt_entity.IsBeingPlaced() )
35 string component_name = tgt_entity.GetActionComponentName( target.GetComponentIndex() );
40 ItemBase attachment =
ItemBase.Cast(tgt_entity.FindAttachmentBySlotName(component_name));
42 if ( attachment && player.GetInventory().CanAddEntityIntoInventory(attachment) && attachment.IsTakeable() )
50 override bool CanBeUsedOnBack()
55 override bool InventoryReservation(
ActionData action_data)
62 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
65 if ( tgt_entity &&
ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
68 if ( action_data.m_Player.GetInventory().HasInventoryReservation( attachment, il) )
74 action_data.m_Player.GetInventory().AddInventoryReservationEx( attachment, il,
GameInventory.c_InventoryReservationTimeoutMS);
81 action_data.m_ReservedInventoryLocations.Insert(il);
87 override void OnExecuteServer(
ActionData action_data )
94 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
97 if ( tgt_entity &&
ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
101 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
105 float stackable = attachment.GetTargetQuantityMax(il.GetSlot());
107 if( stackable == 0 || stackable >= attachment.GetQuantity() )
109 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
113 attachment.SplitIntoStackMaxToInventoryLocationClient( il );
119 override void OnExecuteClient(
ActionData action_data )
123 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
126 if ( tgt_entity &&
ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
130 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
134 float stackable = attachment.GetTargetQuantityMax(il.GetSlot());
136 if( stackable == 0 || stackable >= attachment.GetQuantity() )
138 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
142 attachment.SplitIntoStackMaxToInventoryLocationClient( il );