Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 };
SCR_BaseRoleCallsign
Definition: SCR_BaseRoleCallsign.c:2
ERoleCallsign
ERoleCallsign
Definition: ERoleCallsign.c:4
BaseContainerCustomStringTitleField
class SCR_HitZoneGroupNameHolder BaseContainerCustomStringTitleField("USE INHERENT VERSION ONLY!")
Definition: SCR_HitZoneGroupNameHolder.c:27
SCR_RadioOperatorRoleCallsign
Definition: SCR_RadioOperatorRoleCallsign.c:2
LoadoutBackpackArea
Definition: LoadoutBackpackArea.c:12
SCR_AIGroup
Definition: SCR_AIGroup.c:68
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