Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
metalgearsloth
2022-05-19 14:44:24 +10:00
committed by GitHub
parent a6a25e30e5
commit 8d6a3ecea7
12 changed files with 133 additions and 22 deletions

View File

@@ -83,8 +83,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
_aliveNukeops.Clear();
var numOps = (int)Math.Min(Math.Floor((double)ev.PlayerPool.Count / _cfg.GetCVar(CCVars.NukeopsPlayersPerOp)),
_cfg.GetCVar(CCVars.NukeopsMaxOps));
// Between 1 and <max op count>: needs at least n players per op.
var numOps = Math.Max(1,
(int)Math.Min(
Math.Floor((double)ev.PlayerPool.Count / _cfg.GetCVar(CCVars.NukeopsPlayersPerOp)), _cfg.GetCVar(CCVars.NukeopsMaxOps)));
var ops = new IPlayerSession[numOps];
for (var i = 0; i < numOps; i++)
{