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) )
81 action_data.m_ReservedInventoryLocations.Insert(il);
87 override void OnExecute( ActionData action_data )
89 if (
GetGame().IsDedicatedServer())
97 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
100 if ( tgt_entity &&
ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
104 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
108 float stackable = attachment.GetTargetQuantityMax(il.GetSlot());
110 if( stackable == 0 || stackable >= attachment.GetQuantity() )
112 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
116 attachment.SplitIntoStackMaxToInventoryLocationClient( il );