571 {
572 if ( ItemManager.GetInstance().IsMicromanagmentMode() )
573 return false;
574
575 bool found = false;
576 if (focusedEntity)
577 {
578 InventoryLocation il = new InventoryLocation;
579 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
581
583 {
584 found = false;
585 }
586 else if (!found)
587 {
588 for (int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
589 {
590 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
591 EntityAI slot_item = player.GetInventory().FindAttachment( slot_id );
592 if (slot_item && player.GetInventory().CanSwapEntitiesEx( focusedEntity, slot_item ))
593 {
594 found = true;
595 break;
596 }
597
598 }
599 }
600 }
601 return found;
602 }
FindInventoryLocationType
flags for searching locations in inventory
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment