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();
106 for (
int x = 0;
x < child_count; ++
x )
111 string inventory_slot_name;
112 GetGame().
ConfigGetText(
"CfgNonAIVehicles "+ child_name +
" inventorySlot", inventory_slot_name);
114 if ( cfg_attachments.Find( inventory_slot_name ) > 0 )
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)
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.
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.
proto native CGame GetGame()
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.