554 {
555 bool SwapToPrevious = true;
556 InventoryLocation src1 = new InventoryLocation();
557 InventoryLocation src2 = new InventoryLocation();
558 dst = new InventoryLocation();
559 GameInventory item1Inventory = item1.GetInventory();
561 {
562 if (item1.m_OldLocation && item1.m_OldLocation.IsValid() && !item1.m_OldLocation.CollidesWith(src2) && item1.m_OldLocation.GetParent() && item1.m_OldLocation.GetParent().GetHierarchyRootPlayer())
563 {
564 dst.Copy(item1.m_OldLocation);
565
567 {
569 for (int i = 0; i < count; ++i)
570 {
571 int slotID = item1Inventory.
GetSlotId(i);
573 return false;
574 }
575 }
576
577 if (!item1.m_OldLocation.GetParent().GetInventory().LocationCanAddEntity(item1.m_OldLocation))
578 SwapToPrevious = false;
579
581 SwapToPrevious = false;
582
583 if (SwapToPrevious)
584 return true;
585 }
586 }
587
588 return false;
589 }
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