DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CanEquipEx()

bool LayoutHolder::CanEquipEx ( EntityAI focusedEntity)
inlineprotected

См. определение в файле Container.c строка 570

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());
580 found = player.GetInventory().FindFreeLocationFor(focusedEntity,FindInventoryLocationType.ATTACHMENT, il);
581
582 if (found && il.GetParent().GetInventory().FindAttachment(il.GetSlot()))
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 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:4074
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment

Перекрестные ссылки g_Game, ItemManager::GetInstance(), InventoryLocation::GetParent(), InventoryLocation::GetSlot() и ItemManager::IsMicromanagmentMode().

Используется в CanEquip().