23 if (targetEntity && item)
25 if (!targetEntity.GetInventory())
28 int slotsCount = item.GetInventory().GetSlotIdCount();
30 targetEntity.GetActionComponentNameList(target.GetComponentIndex(), selections);
32 foreach (
string selection : selections)
35 if (!targetEntity.TranslateSlotFromSelection(selection, slotId))
41 for (
int i=0; i < slotsCount; ++i)
43 int itemSlotId = item.GetInventory().GetSlotId(i);
44 if (slotId == itemSlotId)
46 ItemBase currentAttachment =
ItemBase.Cast(targetEntity.GetInventory().FindAttachment(slotId));
47 if (currentAttachment)
54 if (targetEntity.GetInventory() && targetEntity.GetInventory().CanAddAttachment(item))
69 if (!
GetGame().IsDedicatedServer() )
74 if (super.SetupAction( player, target, item, action_data, extra_data))
76 if (!
GetGame().IsDedicatedServer())
100 if (target.GetObject() && target.GetObject().CanUseConstruction())
142 attachment.CombineItemsClient(itemEntity);
147 float stackable = item_base.GetTargetQuantityMax( action_data_a.
m_AttSlot );
149 if (stackable == 0 || stackable >= item_base.GetQuantity())
151 action_data.
m_Player.PredictiveTakeEntityToTargetAttachmentEx(targetEntity, itemEntity, action_data_a.
m_AttSlot);
153 else if (stackable != 0 && stackable < item_base.GetQuantity())
155 item_base.SplitIntoStackMaxClient(targetEntity, action_data_a.
m_AttSlot);
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearInventoryReservationEx(ActionData action_data)
class ActionTargets ActionTarget
int FindSlotIdToAttachOrCombine(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteServer(ActionData action_data)
override ActionData CreateActionData()
void ActionAttachOnSelection()
override void CreateConditionComponents()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=null)
override void OnExecuteClient(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
ref ActionTarget m_Target
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
const int INVALID
Invalid slot (-1)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()