575 {
576 if ( ItemManager.GetInstance().IsMicromanagmentMode() )
577 return false;
578
579 bool found = false;
580 if (focusedEntity)
581 {
582 InventoryLocation il = new InventoryLocation;
583 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
585
587 {
588 found = false;
589 }
590 else if (!found)
591 {
592 for (int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
593 {
594 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
595 EntityAI slot_item = player.GetInventory().FindAttachment( slot_id );
596 if (slot_item && player.GetInventory().CanSwapEntitiesEx( focusedEntity, slot_item ))
597 {
598 found = true;
599 break;
600 }
601
602 }
603 }
604 }
605 return found;
606 }
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