Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIIsValidAction.c
Go to the documentation of this file.
2{
3 private SCR_AIBaseUtilityComponent m_Utility;
4 protected override bool TestFunction(AIAgent owner)
5 {
6 if (!m_Utility)
7 {
8 m_Utility = SCR_AIBaseUtilityComponent.Cast(owner.FindComponent(SCR_AIBaseUtilityComponent));
9 if (!m_Utility)
10 return false;
11 }
12
13 SCR_AIActionBase executedAction = SCR_AIActionBase.Cast(m_Utility.GetExecutedAction());
14
15 if (!executedAction)
16 return false;
17
18 // There seems to be a bug that RunBT node keeps running previous tree if we provide an empty string
19 if (executedAction.m_sBehaviorTree == string.Empty)
20 return false;
21
22 EAIActionState state = executedAction.GetActionState();
23 return state != EAIActionState.COMPLETED && state != EAIActionState.FAILED;
24 }
25
26 protected static override bool VisibleInPalette()
27 {
28 return true;
29 }
30
31 protected static override string GetOnHoverDescription()
32 {
33 return "Test if current action is still valid, or it was already completed or failed";
34 }
35};
override bool TestFunction(AIAgent owner)
static override bool VisibleInPalette()
static override string GetOnHoverDescription()
EAIActionState