301 {
302 attachments.Clear();
303
304 string cfg_path = "cfgVehicles" + " " + target.GetType() + " "+ "GUIInventoryAttachmentsProps";
305 if (
GetGame().ConfigIsExisting( cfg_path ) )
306 {
308
309 for ( int i = 0; i < child_count; i++ )
310 {
311 string child_name;
313
314 string child_selection;
316
317 if ( selection == child_selection )
318 {
319 ref array<string> attachment_slots = new array<string>;
321
322 for ( int j = 0; j < attachment_slots.Count(); ++j )
323 {
324 int target_slot_id = InventorySlots.GetSlotIdFromString( attachment_slots.Get( j ) );
325
326
327 EntityAI attachment = target.GetInventory().FindAttachment( target_slot_id );
328 if ( attachment && target.GetInventory().CanRemoveAttachmentEx( attachment, target_slot_id ) && !target.GetInventory().GetSlotLock( target_slot_id ) )
329 {
330 attachments.Insert( attachment );
331 }
332 }
333 }
334 }
335 }
336 }
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.
proto native CGame GetGame()