DayZ 1.29
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

См. определение в файле 3_Game/DayZ/Systems/Inventory/Inventory.c строка 926

927 {
928 InventoryLocation il = new InventoryLocation();
929 bool result = FindFreeLocationFor(item, FindInventoryLocationType.ANY, il);
930 if (result)
931 return LocationAddEntity(il);
932
933 return result;
934 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
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().