Skip to content

Commit 63468cb

Browse files
committed
allow overflow of attack plaeyrs past squad size
1 parent 97568eb commit 63468cb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ZkLobbyServer/SpringieInterface/PlanetWarsMatchMaker.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,20 @@ private void RunSquadFormation()
265265
foreach (var p in fillers) pool.Remove(p);
266266
}
267267

268+
// Pass 3: absorb leftovers into an existing squad on their original planet,
269+
// so all attackers join when a planet had more people than TeamSize.
270+
foreach (var name in pool.ToList())
271+
{
272+
var originalPlanetId = playerPlanet[name].PlanetID;
273+
var squad = FormedSquads.FirstOrDefault(s => s.PlanetID == originalPlanetId);
274+
if (squad != null)
275+
{
276+
squad.Attackers.Add(name);
277+
squad.TeamSize = squad.Attackers.Count;
278+
pool.Remove(name);
279+
}
280+
}
281+
268282
AttackOptions.Clear();
269283

270284
// initialize defender votes for attacked planets

0 commit comments

Comments
 (0)