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

◆ CanReceiveAttachment()

override bool InventoryItem::CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected

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

4081 {
4082 //removed 15.06. coz of loading from storage -> after load items in cargo was lost -> waiting for proper solution
4083 //if (GetHealthLevel() == GameConstants.STATE_RUINED)
4084 // return false;
4085
4086 GameInventory attachmentInv = attachment.GetInventory();
4087 if (attachmentInv && attachmentInv.GetCargo() && attachmentInv.GetCargo().GetItemCount() > 0)
4088 {
4089 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
4090 return false;
4091 }
4092
4093 InventoryLocation loc = new InventoryLocation();
4094 attachment.GetInventory().GetCurrentInventoryLocation(loc);
4095 if (loc && loc.IsValid() && !GetInventory().AreChildrenAccessible())
4096 return false;
4097
4098 return super.CanReceiveAttachment(attachment, slotId);
4099 }
proto native int GetItemCount()
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location

Перекрестные ссылки GameInventory::GetCargo(), CargoBase::GetItemCount() и InventoryLocation::IsValid().