Processes attachments of item given through params.
177 {
179
180 int attachments = params.m_GameInventory.AttachmentCount();
181 for (int attachmentIndex = 0; attachmentIndex < attachments; ++attachmentIndex)
182 {
183 EntityAI attachment = params.m_GameInventory.GetAttachmentFromIndex(attachmentIndex);
186 continue;
187
189 continue;
190
191 InventoryLocation parentInventoryLocation = new InventoryLocation();
192 params.m_GameInventory.GetCurrentInventoryLocation(parentInventoryLocation);
193
194 CachedEquipmentItemAttribute newItemAttributes = new CachedEquipmentItemAttribute();
195 newItemAttributes.m_Entity = attachment;
196 newItemAttributes.m_Parent = attachment.GetHierarchyParent();
197 newItemAttributes.m_ParentInventoryPlacement = parentInventoryLocation.
GetSlot();
198 newItemAttributes.m_InventoryDepth = attachment.GetHierarchyLevel();
199 newItemAttributes.m_SlotIndex = params.m_SlotId;
201
202 array<ref CachedEquipmentItemAttribute> arr;
203 if (!attachmentAttributesPerCategory.Find(category, arr))
204 {
205 arr = new array<ref CachedEquipmentItemAttribute>();
206 attachmentAttributesPerCategory.Set(category, arr);
207 }
208
209 #ifdef ENABLE_LOGGING
210 LogMessage(string.Format("parent:%1 entity:%2", newItemAttributes.m_Parent, attachment), string.Format("%1:ProcessAttachments", params.m_CallerMethod));
211 #endif
212
213 arr.Insert(newItemAttributes);
214 }
215
216 return attachmentAttributesPerCategory;
217 }
map CachedItemAttributesPerCategory
ECachedEquipmentItemCategory
ECachedEquipmentOperationMode
ECachedEquipmentPlacement
bool IsStored(Entity entity, ECachedEquipmentItemCategory category)
proto native int GetSlot()
returns slot id if current type is Attachment