251 {
252 string cfg_path = "cfgVehicles" + " " + target.GetType() + " "+ "GUIInventoryAttachmentsProps";
253
254 if (
GetGame().ConfigIsExisting( cfg_path ) )
255 {
257
258 for ( int i = 0; i < child_count; i++ )
259 {
260 string child_name;
262
263 string child_selection;
265
266 if ( selection == child_selection )
267 {
268 ref array<string> attachment_slots = new array<string>;
270
271 for ( int j = 0; j < attachment_slots.Count(); ++j )
272 {
273 int target_slot_id = InventorySlots.GetSlotIdFromString( attachment_slots.Get( j ) );
274 int item_slot_count = item_to_attach.GetInventory().GetSlotIdCount();
275
276 for ( int k = 0; k < item_slot_count; ++k )
277 {
278 int item_slot_id = item_to_attach.GetInventory().GetSlotId( k );
279 ItemBase attachment_item =
ItemBase.Cast( target.GetInventory().FindAttachment( item_slot_id ) );
280
281 if ( target_slot_id == item_slot_id )
282 {
283 if ( target.GetInventory().CanAddAttachmentEx( item_to_attach, item_slot_id ) && target.CanReceiveAttachment( item_to_attach, item_slot_id ) || attachment_item && attachment_item.
CanBeCombined( item_to_attach ) )
284 {
285 if(target.CanDisplayAttachmentSlot(target_slot_id))
286 return item_slot_id;
287 else
288 return -1;
289 }
290 }
291 }
292 }
293 }
294 }
295 }
296
297 return -1;
298 }
class GP5GasMask extends MaskBase ItemBase
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
proto native CGame GetGame()