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

◆ AddEntityToInventory()

bool GameInventory::AddEntityToInventory ( notnull EntityAI item)
inlineprotected

add entity somewhere in inventory

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

@NOTE: AddEntityToInventory does not perform the checks the CanAddEntityToInventory does (script conditions for example). if not sure, always call CanAddEntityToInventory before AddEntityToInventory.

Аргументы
[in]itemitem to be placed in inventory
Возвращает
true if item can be added, false otherwise

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

925 {
926 InventoryLocation il = new InventoryLocation();
927 bool result = FindFreeLocationFor(item, FindInventoryLocationType.ANY, il);
928 if (result)
929 return LocationAddEntity(il);
930
931 return result;
932 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
static proto native bool LocationAddEntity(notnull InventoryLocation inv_loc)
adds item to inventory location
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.

Перекрестные ссылки FindFreeLocationFor() и LocationAddEntity().