Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InVehicleTurretADSCondition.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  //------------------------------------------------------------------------------------------------
7  override bool IsAvailable(SCR_AvailableActionsConditionData data)
8  {
9  if (!data)
10  return false;
11 
12  // Current weapon
13  BaseControllerComponent controller = data.GetCurrentVehicleController();
14  if (!controller)
15  return GetReturnResult(false);
16 
17  // Turret
18  IEntity turretEntity = controller.GetOwner();
19  if (!turretEntity)
20  return GetReturnResult(false);
21 
22  TurretComponent turret = TurretComponent.Cast(turretEntity.FindComponent(TurretComponent));
23  if (!turret)
24  return GetReturnResult(false);
25 
26  // Sights
27  ScriptedSightsComponent sights = ScriptedSightsComponent.Cast(turret.FindComponent(ScriptedSightsComponent));
28  if (!sights)
29  return GetReturnResult(false);
30 
31  // In sights ADS?
32  bool result = sights.IsSightADSActive();
33 
34  return GetReturnResult(result);
35  }
36 };
SCR_AvailableActionsConditionData
Definition: SCR_AvailableActionsConditionData.c:5
SCR_InVehicleTurretADSCondition
Definition: SCR_InVehicleTurretADSCondition.c:3
SCR_AvailableActionCondition
A single available action condition representation.
Definition: SCR_AvailableActionsCondition.c:3
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468