Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RadioOperatorRoleCallsign.c
Go to the documentation of this file.
3{
4 //------------------------------------------------------------------------------------------------
5 override bool IsValidRole(IEntity character, int playerID, SCR_AIGroup group, inout int roleCallsignIndex, out bool isUnique)
6 {
7 if (!character)
8 return false;
9
10 if (!super.IsValidRole(character, playerID, group, roleCallsignIndex, isUnique))
11 return false;
12
13 if (HasRadio(character))
14 {
15 roleCallsignIndex = GetRoleIndex();
16 return true;
17 }
18
19 return false;
20 }
21
22 //------------------------------------------------------------------------------------------------
23 protected bool HasRadio(notnull IEntity character)
24 {
25 EquipedLoadoutStorageComponent loadoutStorage = EquipedLoadoutStorageComponent.Cast(character.FindComponent(EquipedLoadoutStorageComponent));
26 if (!loadoutStorage)
27 return false;
28
29 IEntity backpack = loadoutStorage.GetClothFromArea(LoadoutBackpackArea);
30 return (backpack && backpack.FindComponent(SCR_RadioComponent));
31 }
32
33 //------------------------------------------------------------------------------------------------
34 override int GetRoleIndex()
35 {
36 return ERoleCallsign.RADIO_OPERATOR;
37 }
38};
ERoleCallsign
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_HitZoneGroupNameHolder BaseContainerCustomStringTitleField("USE INHERITED VERSION ONLY!")
proto external Managed FindComponent(typename typeName)
bool HasRadio(notnull IEntity character)