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() )
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) )
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 );
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 );
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearInventoryReservationEx(ActionData action_data)
class ActionTargets ActionTarget
FindInventoryLocationType
flags for searching locations in inventory
ref array< ref InventoryLocation > m_ReservedInventoryLocations
ref ActionTarget m_Target
override bool CanBeUsedOnBack()
override bool ActionConditionContinue(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
override void CreateConditionComponents()
override bool InventoryReservation(ActionData action_data)
override void OnExecuteClient(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasProneException()
void ActionTakeHybridAttachment()
protected int m_CommandUIDProne
protected int m_CommandUID
script counterpart to engine's class Inventory
const int c_InventoryReservationTimeoutMS
reservations
proto native int GetSlot()
returns slot id if current type is Attachment
override bool IsTakeable()
DayZPlayerConstants
defined in C++
proto native CGame GetGame()