491 {
492 bool SwapToPrevious = true;
493 InventoryLocation src1 = new InventoryLocation();
494 InventoryLocation src2 = new InventoryLocation();
495 dst = new InventoryLocation();
496 GameInventory item1Inventory = item1.GetInventory();
498 {
499 if (item1.m_OldLocation && item1.m_OldLocation.IsValid() && !item1.m_OldLocation.CollidesWith(src2) && item1.m_OldLocation.GetParent() && item1.m_OldLocation.GetParent().GetHierarchyRootPlayer())
500 {
501 dst.Copy(item1.m_OldLocation);
502
504 {
506 for (int i = 0; i < count; ++i)
507 {
508 int slotID = item1Inventory.
GetSlotId(i);
510 return false;
511 }
512 }
513
514 if (!item1.m_OldLocation.GetParent().GetInventory().LocationCanAddEntity(item1.m_OldLocation))
515 SwapToPrevious = false;
516
518 SwapToPrevious = false;
519
520 if (SwapToPrevious)
521 return true;
522 }
523 }
524
525 return false;
526 }
InventoryLocationType
types of Inventory Location
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
proto native int GetSlotId(int index)
attachments
proto native int GetSlotIdCount()
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation