74 {
75 map<int, vector> ret_val = new map<int, vector>();
76
77 string type_name = entity.GetType();
79
80 string cfg_path;
81
83 {
85 }
87 {
89 }
91 {
93 }
94
95 g_Game.ConfigGetTextArray(cfg_path, cfg_attachments);
96
97 int child_count =
g_Game.ConfigGetChildrenCount(
"CfgNonAIVehicles");
98
99 for (
int x = 0;
x < child_count; ++
x)
100 {
101 string child_name;
102 g_Game.ConfigGetChildName(
"CfgNonAIVehicles",
x , child_name);
103
104 string inventory_slot_name;
105 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" inventorySlot", inventory_slot_name);
106
107 if (cfg_attachments.Find(inventory_slot_name) > 0)
108 {
109 string model_path;
110 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" model", model_path);
111
112 if (model_path.
Length() > 5)
113 {
114 LOD lod = entity.GetLODByName(LOD.NAME_VIEW);
115
116 if (lod)
117 {
120
121 array<Selection> selections = new array<Selection>();
123
124 for (int i = 0; i < selections.Count(); ++i)
125 {
126 string selection = selections[i].GetName();
128
130 {
131 ret_val.Set(InventorySlots.GetSlotIdFromString(inventory_slot_name), selections[i].GetVertexPosition(lod, 0));
132 }
133 }
134 }
135 }
136 }
137 }
138
139 return ret_val;
140 }
proto native bool GetSelections(notnull out array< Selection > selections)
class array< Class T > TStringArray
proto native int Length()
Returns length of string.
bool Contains(string sample)
Returns true if sample is substring of string.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto int ToLower()
Changes string to lowercase. Returns length.