33 {
35 if (!item_to_pack)
36 return false;
37
38 if ( !item_to_pack.
IsTakeable() )
return false;
39 if ( item_to_pack.IsBeingPlaced() ) return false;
42
44
45 if ( tgt_parent )
46 {
47 if ( item_to_pack.GetInventory().IsAttachment() )
48 {
49 if ( !item_to_pack.
CanDetachAttachment(tgt_parent) || !tgt_parent.CanReleaseAttachment(item_to_pack) )
50 return false;
51 }
52 else
53 {
54 if ( !item_to_pack.
CanRemoveFromCargo(tgt_parent) || !tgt_parent.CanReleaseCargo(item_to_pack) )
55 return false;
56 }
57 }
58
59 if ( item_to_pack.GetInventory().GetCargo() && item_to_pack.GetInventory().GetCargo().GetItemCount() > 0)
60 return false;
61
62 if ( !item_to_pack.IsWeapon() && item_to_pack.GetInventory().AttachmentCount() > 0)
63 return false;
64
65
68
70 return false;
71
72 return true;
73 }
class GP5GasMask extends MaskBase ItemBase
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
override bool CanDetachAttachment(EntityAI parent)
override bool CanRemoveFromCargo(EntityAI parent)
override bool CanPutInCargo(EntityAI parent)
override bool IsTakeable()
proto native CGame GetGame()