Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoWeaponUnobstructed.c
Go to the documentation of this file.
2{
3 static override bool VisibleInPalette() { return true; }
4
5 protected CharacterControllerComponent m_CharacterController;
6 protected CompartmentAccessComponent m_CompartmentAccess;
7 protected bool m_bInitialized;
8
9 override bool TestFunction(AIAgent owner)
10 {
11 if (!m_bInitialized)
12 return false;
13
14 // Don't care if in compartment
15 if (m_CompartmentAccess.GetCompartment())
16 return true;
17
18 return m_CharacterController.GetWeaponObstructedState() == EWeaponObstructedState.UNOBSTRUCTED;
19 }
20
21 override void OnInit(AIAgent owner)
22 {
23 IEntity controlledEntity = owner.GetControlledEntity();
24 m_CharacterController = CharacterControllerComponent.Cast(controlledEntity.FindComponent(CharacterControllerComponent));
25 m_CompartmentAccess = CompartmentAccessComponent.Cast(controlledEntity.FindComponent(CompartmentAccessComponent));
27 }
28
29 static override string GetOnHoverDescription()
30 {
31 return "Returns TRUE if current weapon is not obstructed";
32 }
33}
override bool VisibleInPalette()
proto external Managed FindComponent(typename typeName)
override bool TestFunction(AIAgent owner)
CompartmentAccessComponent m_CompartmentAccess
override void OnInit(AIAgent owner)
static override string GetOnHoverDescription()
CharacterControllerComponent m_CharacterController
EWeaponObstructedState