7 if( !e.IgnoreOutOfReachCondition() )
10 if( player.IsInVehicle() )
22 if( att_slot_name !=
"" )
24 if( e.MemoryPointExists(att_slot_name) )
26 vector mem_point = e.GetMemoryPointPos(att_slot_name);
27 pos_att = e.ModelToWorld(mem_point);
36 vector pos_player = player.GetPosition();
38 float height_diff =
Math.
AbsFloat( pos_player[1] - pos_att[1] );
39 if( height_diff < range )
68 string type_name = e.GetType();
77 return m_AttData.Get( type_name ).Get( slot_id );
84 string type_name = entity.GetType();
102 g_Game.ConfigGetTextArray(cfg_path, cfg_attachments);
104 int child_count =
g_Game.ConfigGetChildrenCount(
"CfgNonAIVehicles");
106 for (
int x = 0;
x < child_count; ++
x )
109 g_Game.ConfigGetChildName(
"CfgNonAIVehicles",
x , child_name);
111 string inventory_slot_name;
112 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" inventorySlot", inventory_slot_name);
114 if ( cfg_attachments.Find( inventory_slot_name ) > 0 )
117 g_Game.ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" model", model_path);
119 if ( model_path.
Length() > 5 )
131 for (
int i = 0; i < selections.Count(); ++i )
133 string selection = selections[i].GetName();
136 if ( selection.
Contains(model_path) )
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.
array< string > 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.