Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AICharacterLeanOnAbort.c
Go to the documentation of this file.
2{
3 protected bool m_bAbortDone;
4
5 //-----------------------------------------------------------------------------------------------------------------------------------------
6 protected static override bool VisibleInPalette()
7 {
8 return true;
9 }
10
11 //-----------------------------------------------------------------------------------------------------------------------------------------
12 protected static override bool CanReturnRunning()
13 {
14 return true;
15 }
16
17 //-----------------------------------------------------------------------------------------------------------------------------------------
18 protected override void OnEnter(AIAgent owner)
19 {
20 m_bAbortDone = false;
21 }
22
23 //-----------------------------------------------------------------------------------------------------------------------------------------
24 protected override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
25 {
26 return ENodeResult.RUNNING;
27 }
28
29 //-----------------------------------------------------------------------------------------------------------------------------------------
30 protected override void OnAbort(AIAgent owner, Node nodeCausingAbort)
31 {
32 if (m_bAbortDone)
33 return;
34 IEntity ent = owner.GetControlledEntity();
35 if (!ent)
36 {
37 NodeError(this, owner, "Abort called on AIAgent without entity. Invalid usage.");
38 };
39 CharacterControllerComponent cc = CharacterControllerComponent.Cast(ent.FindComponent(CharacterControllerComponent));
40 if (cc && cc.IsLeaning())
41 {
42 cc.SetWantedLeaning(0);
43 };
44 m_bAbortDone = true;
45 }
46
47 //-----------------------------------------------------------------------------------------------------------------------------------------
48 override static string GetOnHoverDescription()
49 {
50 return "Clears leaning state of owner entity OnAbort";
51 }
52};
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition NodeError.c:3
proto external Managed FindComponent(typename typeName)
Definition Node.c:13
override void OnAbort(AIAgent owner, Node nodeCausingAbort)
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
static override bool VisibleInPalette()
override void OnEnter(AIAgent owner)
static override string GetOnHoverDescription()
static override bool CanReturnRunning()
ENodeResult
Definition ENodeResult.c:13