7 if (!e.IgnoreOutOfReachCondition())
10 if (player.IsInVehicle())
21 if (att_slot_name !=
"")
23 if (e.MemoryPointExists(att_slot_name))
25 vector mem_point = e.GetMemoryPointPos(att_slot_name);
26 posAtt = e.ModelToWorld(mem_point);
34 vector posPlayer = player.GetPosition();
35 float heightDiff = posAtt[1] - posPlayer[1];
37 float negativeTolerance = -1.0;
38 if (heightDiff >= negativeTolerance && (
Math.
AbsFloat(heightDiff) < range))
61 string type_name = e.GetType();
70 return m_AttData.Get(type_name).Get(slot_id);
77 string type_name = entity.GetType();
95 g_Game.ConfigGetTextArray(cfg_path, cfg_attachments);
97 int child_count =
g_Game.ConfigGetChildrenCount(
"CfgNonAIVehicles");
99 for (
int x = 0;
x < child_count; ++
x)
102 g_Game.ConfigGetChildName(
"CfgNonAIVehicles",
x , child_name);
104 string inventory_slot_name;
105 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" inventorySlot", inventory_slot_name);
107 if (cfg_attachments.Find(inventory_slot_name) > 0)
110 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" model", model_path);
112 if (model_path.
Length() > 5)
124 for (
int i = 0; i < selections.Count(); ++i)
126 string selection = selections[i].GetName();
static ref map< string, ref map< int, vector > > m_AttData
static bool IsAttachmentReachable(EntityAI e, string att_slot_name="", int slot_id=-1, float range=1.5)
static vector GetAttachmentPosition(EntityAI e, int slot_id)
map< int, vector > CreateAttachmentPosition(EntityAI entity)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
static const string NAME_VIEW
proto native bool GetSelections(notnull out array< Selection > selections)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
class array< Class T > TStringArray
static proto float AbsFloat(float f)
Returns absolute value.
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.