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

◆ CanReceiveAttachment()

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

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

4201 {
4202 //removed 15.06. coz of loading from storage -> after load items in cargo was lost -> waiting for proper solution
4203 //if (GetHealthLevel() == GameConstants.STATE_RUINED)
4204 // return false;
4205
4206 GameInventory attachmentInv = attachment.GetInventory();
4207 if (attachmentInv && attachmentInv.GetCargo() && attachmentInv.GetCargo().GetItemCount() > 0)
4208 {
4209 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
4210 return false;
4211 }
4212
4213 InventoryLocation loc = new InventoryLocation();
4214 attachment.GetInventory().GetCurrentInventoryLocation(loc);
4215 if (loc && loc.IsValid() && !GetInventory().AreChildrenAccessible())
4216 return false;
4217
4218 return super.CanReceiveAttachment(attachment, slotId);
4219 }
proto native int GetItemCount()
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location

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