88 {
89 if (
GetGame().IsDedicatedServer())
90 {
92 return;
93 }
94
95
97 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
99
100 if ( tgt_entity &&
ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
101 {
102 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
103 InventoryLocation targetInventoryLocation = new InventoryLocation;
104 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
106
107
108 float stackable = attachment.GetTargetQuantityMax(il.
GetSlot());
109
110 if( stackable == 0 || stackable >= attachment.GetQuantity() )
111 {
112 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
113 }
114 else
115 {
116 attachment.SplitIntoStackMaxToInventoryLocationClient( il );
117 }
118 }
119
120 }
class GP5GasMask extends MaskBase ItemBase
void ClearActionJuncture(ActionData action_data)
void ClearInventoryReservationEx(ActionData action_data)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native CGame GetGame()