Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoTestIsAgentInGroup.c
Go to the documentation of this file.
2{
3 protected override bool TestFunction(AIAgent agent, IEntity controlled)
4 {
5 if (!controlled)
6 return false;
7 AIGroup group = AIGroup.Cast(agent);
8 if (!group)
9 return false;
10 AIControlComponent contr = AIControlComponent.Cast(controlled.FindComponent(AIControlComponent));
11 if (!contr)
12 return false;
13 AIAgent agToTest = contr.GetAIAgent();
14 if (!group || !agToTest)
15 return false;
16
17 array<AIAgent> agents = {};
18 group.GetAgents(agents);
19 return agents.Contains(agToTest);
20 }
21};
proto external Managed FindComponent(typename typeName)
override bool TestFunction(AIAgent agent, IEntity controlled)