Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoTestIsAvailable.c
Go to the documentation of this file.
1 class SCR_AIDecoTestIsAvailable : DecoratorTestScripted
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 };
SCR_ChimeraAIAgent
Definition: SCR_ChimeraAIAgent.c:5
SCR_AIDecoTestIsAvailable
Definition: SCR_AIDecoTestIsAvailable.c:1