54 {
56 string selection = base_building.GetActionComponentName(target.GetComponentIndex());
57
58 if (selection.
Length() > 0)
59 {
60 int delimiter_index = selection.
IndexOfFrom(0,
"_mounted");
61 if (delimiter_index > -1)
62 {
63 selection = selection.
Substring(0, delimiter_index);
64 }
65
66
67
68
69 }
70
71 return selection;
72 }
proto native int Length()
Returns length of string.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.