5 override bool IsAvailable(
int value,
bool isOngoing)
8 if (!campaignGameMode || !campaignGameMode.GetCommanderRoleEnabled())
16 Faction playerFaction = fManager.GetPlayerFaction(value);
27 return (playerFaction == playerFactionLocal);
29 PlayerController playerController =
GetGame().GetPlayerController();
31 if (!playerController)
34 if (value != playerController.GetPlayerId())
40 SCR_FactionCommanderHandlerComponent handlerComponent = SCR_FactionCommanderHandlerComponent.GetInstance();
42 if (!handlerComponent)
45 if (handlerComponent.CheckRank())
47 IEntity player = playerController.GetControlledEntity();
56 SCR_FactionCommanderPlayerComponent comp = SCR_FactionCommanderPlayerComponent.Cast(playerController.FindComponent(SCR_FactionCommanderPlayerComponent));
67 WorldTimestamp ReplaceCommanderCooldown = comp.GetReplaceCommanderCooldownTimestamp();
68 if (ReplaceCommanderCooldown.Greater(currentTimestamp))
71 return world.GetServerTimestamp().GreaterEqual(comp.GetNextVolunteeringTimestamp());
83 targetFaction = factionManager.GetPlayerFaction(
m_iValue);
89 array<int> players = {};
91 for (
int i = 0, count =
GetGame().GetPlayerManager().
GetPlayers(players); i < count; i++)
93 playerFaction = factionManager.GetPlayerFaction(players[i]);
95 if (targetFaction == playerFaction)
104 override bool CanSendNotification(
int value)
111 return (fManager.GetPlayerFaction(value) == fManager.GetLocalPlayerFaction());
123 SCR_FactionCommanderHandlerComponent component = SCR_FactionCommanderHandlerComponent.GetInstance();
146 return super.GetWinner();