8 override void CreateConditionComponents()
24 if ( target_entity && target_entity.CanUseConstruction() )
26 string selection = target_entity.GetActionComponentName( target.GetComponentIndex() );
28 int slot_id = construction_action_data.GetAttachmentSlotFromSelection( player, target_entity, item, selection );
34 if ( base_building.CheckSlotVerticalDistance( slot_id, player ) && base_building.IsPlayerInside(player,
"") )
36 construction_action_data.SetSlotId( slot_id );
41 else if ( item.IsKindOf(
"CombinationLock") )
55 construction_action_data.SetSlotId( loc.GetSlot() );
65 override void OnStartClient(
ActionData action_data )
69 construction_action_data.SetActionInitiator( action_data.m_Player );
72 protected void OnExecuteImpl(
ActionData action_data )
78 int slot_id = construction_action_data.GetSlotId();
82 ItemBase attachment =
ItemBase.Cast( target_entity.GetInventory().FindAttachment( slot_id ) );
87 attachment.CombineItemsClient( item );
92 float stackable = item_base.GetTargetQuantityMax( slot_id );
94 if( stackable == 0 || stackable >= item_base.GetQuantity() )
96 action_data.m_Player.PredictiveTakeEntityToTargetAttachmentEx(target_entity, item, slot_id);
98 else if( stackable != 0 && stackable < item_base.GetQuantity() )
100 item_base.SplitIntoStackMaxClient( target_entity, slot_id );
106 override void OnExecuteClient(
ActionData action_data )
109 OnExecuteImpl(action_data);
112 override void OnExecuteServer(
ActionData action_data )
114 if ( !
GetGame().IsMultiplayer() )
118 OnExecuteImpl(action_data);