Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_WeaponChangeSwitchOpticsCondition.c
Go to the documentation of this file.
3{
4 //------------------------------------------------------------------------------------------------
6 override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
7 {
9 if (!controlledEntity)
10 return null;
11
12 ChimeraCharacter character = ChimeraCharacter.Cast(controlledEntity);
13 if (!character)
14 return null;
15
16 BaseWeaponManagerComponent weaponManager = character.GetCharacterController().GetWeaponManagerComponent();
17 if (!weaponManager)
18 return null;
19
20 BaseWeaponComponent currentSights = weaponManager.GetCurrentWeapon();
21 if (!currentSights)
22 return null;
23
24 bool canSwitchOptics;
25
26 if (currentSights.FindAvailableSights() == 0)
27 canSwitchOptics = currentSights.CanSetSights(1);
28 else if(currentSights.FindAvailableSights() == 1)
29 canSwitchOptics = currentSights.CanSetSights(0);
30
31 return canSwitchOptics;
32 }
33}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
A single available action condition representation.
static IEntity GetLocalControlledEntity()