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

◆ CanEquipEx()

bool LayoutHolder::CanEquipEx ( EntityAI focusedEntity)
inlineprotected

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

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(GetGame().GetPlayer());
584 found = player.GetInventory().FindFreeLocationFor(focusedEntity,FindInventoryLocationType.ATTACHMENT, il);
585
586 if (found && il.GetParent().GetInventory().FindAttachment(il.GetSlot()))
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 }
class LogManager EntityAI
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native CGame GetGame()

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

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