var antags = Math.Clamp(allPlayers.Count / antagsPerPlayer, 1, maxAntags);
for (var antag = 0; antag < antags; antag++)
{
- IPlayerSession chosenPlayer;
+ IPlayerSession chosenPlayer = null!;
if (prefList.Count == 0)
{
if (playerList.Count == 0)
{
break;
}
- chosenPlayer = _random.PickAndTake(playerList);
}
else
{
var query = QueryActiveRules();
while (query.MoveNext(out _, out var comp, out _))
{
- _antagSelection.EligiblePlayers(comp.RevPrototypeId, comp.MaxHeadRevs, comp.PlayersPerHeadRev, comp.HeadRevStartSound,
+ _antagSelection.EligiblePlayers(comp.HeadRevPrototypeId, comp.MaxHeadRevs, comp.PlayersPerHeadRev, comp.HeadRevStartSound,
"head-rev-role-greeting", "#5e9cff", out var chosen);
- GiveHeadRev(chosen, comp.RevPrototypeId, comp);
+ if (!chosen.Any())
+ GiveHeadRev(chosen, comp.RevPrototypeId, comp);
+ else
+ {
+ _chatManager.SendAdminAnnouncement(Loc.GetString("rev-no-heads"));
+ }
}
}
rev-not-enough-ready-players = Not enough players readied up for the game. There were {$readyPlayersCount} players readied up out of {$minimumPlayers} needed. Can't start a Revolution.
rev-no-one-ready = No players readied up! Can't start a Revolution.
+rev-no-heads = There were no Head Revolutionaries to be selected. Can't start a Revolution.
rev-all-heads-dead = All the heads are dead, now finish up the rest of the crew!