Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TurretGetInUserAction.c
Go to the documentation of this file.
2 {
3  //------------------------------------------------------------------------------------------------
4  override bool CanBePerformedScript(IEntity user)
5  {
6  if (!IsTurretOperational())
7  return false;
8 
9  return super.CanBePerformedScript(user);
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  override bool CanBeShownScript(IEntity user)
14  {
15  if (!IsTurretOperational())
16  return false;
17 
18  return super.CanBeShownScript(user);
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  bool IsTurretOperational()
23  {
24  // Check if destroyed
26  if (damageManager && damageManager.GetState() == EDamageState.DESTROYED)
27  return false;
28 
29  // Check WeaponSlot
30  WeaponSlotComponent weaponSlot = WeaponSlotComponent.Cast(GetOwner().FindComponent(WeaponSlotComponent));
31  if (!weaponSlot)
32  return false;
33 
34  if (!weaponSlot.GetWeaponEntity())
35  return false;
36 
37  return true;
38  }
39 };
SCR_TurretGetInUserAction
Definition: SCR_TurretGetInUserAction.c:1
EDamageState
EDamageState
Definition: EDamageState.c:12
WeaponSlotComponent
Definition: WeaponSlotComponent.c:12
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SCR_GetInUserAction
Definition: SCR_GetInUserAction.c:1
DamageManagerComponent
Definition: DamageManagerComponent.c:12