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

◆ UpdateParents()

void CachedEquipmentStorageBase::UpdateParents ( )
inlineprotected

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

175 {
176 array<ECachedEquipmentItemCategory> categories = m_ItemsCacheByCategory.GetKeyArray();
177 if (!categories)
178 return;
179
180 InventoryLocation parentInventoryLocation = new InventoryLocation();
181
182 foreach (ECachedEquipmentItemCategory category : categories)
183 {
184 if (!m_ItemsCacheByCategory[category])
185 continue;
186
187 foreach (int index, CachedEquipmentItemAttribute itemAttributes : m_ItemsCacheByCategory[category])
188 {
189 if (!itemAttributes || !itemAttributes.m_Parent)
190 continue;
191
192 EntityAI parent;
193 if (!Class.CastTo(parent, itemAttributes.m_Parent))
194 continue;
195
196 GameInventory parentInventory = parent.GetInventory();
197 if (!parentInventory)
198 continue;
199
200 parentInventory.GetCurrentInventoryLocation(parentInventoryLocation);
201 itemAttributes.m_ParentInventoryPlacement = parentInventoryLocation.GetSlot();
202 }
203 }
204 }
class LogManager EntityAI
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
ref map< ECachedEquipmentItemCategory, ref array< ref CachedEquipmentItemAttribute > > m_ItemsCacheByCategory
Определения CachedEquipmentStorageBase.c:52
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
proto native int GetSlot()
returns slot id if current type is Attachment

Перекрестные ссылки Class::CastTo(), GameInventory::GetCurrentInventoryLocation(), InventoryLocation::GetSlot() и m_ItemsCacheByCategory.

Используется в CachedEquipmentStorage::OnItemAttached().