Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoTestIsAvailable.c
Go to the documentation of this file.
2{
3
4 //------------------------------------------------------------------------------------------------
5 protected override bool TestFunction(AIAgent agent, IEntity controlled)
6 {
7 if (controlled)
8 {
9 AIControlComponent aiContr = AIControlComponent.Cast(controlled.FindComponent(AIControlComponent));
10 if (!aiContr)
11 return false;
12 SCR_ChimeraAIAgent chimeraAgent = SCR_ChimeraAIAgent.Cast(aiContr.GetAIAgent());
13 if (!chimeraAgent)
14 return false;
15 auto infoComponent = chimeraAgent.m_InfoComponent;
16 if (!infoComponent)
17 {
18 Debug.Error("Missing AIInfoComponent in for IEntity: " + controlled.ToString());
19 return false;
20 }
21 return infoComponent.GetAIState() == EUnitAIState.AVAILABLE;
22 }
23 return false;
24 }
25};
Definition Debug.c:13
proto external Managed FindComponent(typename typeName)
override bool TestFunction(AIAgent agent, IEntity controlled)