Processes cargo of item given through params.
226 {
228 if (params.m_GameInventory.GetCargo())
229 {
230 int cargoCount = params.m_GameInventory.GetCargo().GetItemCount();
231 for (int cargoIndex = 0; cargoIndex < cargoCount; ++cargoIndex)
232 {
233 EntityAI cargo = params.m_GameInventory.GetCargo().GetItem(cargoIndex);
236 continue;
237
239 continue;
240
241 InventoryLocation parentInventoryLocation = new InventoryLocation();
242 params.m_GameInventory.GetCurrentInventoryLocation(parentInventoryLocation);
243
244 CachedEquipmentItemAttribute newItemAttributes = new CachedEquipmentItemAttribute();
245
246 newItemAttributes.m_Entity = cargo;
247 newItemAttributes.m_Parent = cargo.GetHierarchyParent();
248 newItemAttributes.m_ParentInventoryPlacement = parentInventoryLocation.
GetSlot();
249 newItemAttributes.m_InventoryDepth = cargo.GetHierarchyLevel();
251
252
253 array<ref CachedEquipmentItemAttribute> arr;
254 if (!cargoAttributesPerCategory.Find(category, arr))
255 {
256 arr = new array<ref CachedEquipmentItemAttribute>();
257 cargoAttributesPerCategory.Set(category, arr);
258 }
259
260 #ifdef ENABLE_LOGGING
261 LogMessage(string.Format("parent:%1 entity:%2", newItemAttributes.m_Parent, cargo), string.Format("%1:ProcessCargo", params.m_CallerMethod));
262 #endif
263
264 arr.Insert(newItemAttributes);
265 }
266 }
267
268 return cargoAttributesPerCategory;
269 }
map CachedItemAttributesPerCategory
ECachedEquipmentItemCategory
ECachedEquipmentOperationMode
ECachedEquipmentPlacement
bool IsStored(Entity entity, ECachedEquipmentItemCategory category)
proto native int GetSlot()
returns slot id if current type is Attachment