CRASHFIX: matchmaking was broken when two teams were already in a queue and a solo player joined

This commit is contained in:
marco_a 2024-06-09 23:23:01 +02:00
parent 401e18760a
commit 0022ba6492

View File

@ -378,13 +378,21 @@ function arena_lib.queue_to_arena(mod, arena)
-- sennò..
else
local all_max_curr_amount = false
-- metto vero di base in caso già tutte le squadre disponibili abbiano lo
-- stesso ammontare di membri. Smentisco eventualmente nel for sottostante
local all_max_curr_amount = true
for _, amount in pairs(arena.players_amount_per_team) do
if amount < max_curr_amount then
all_max_curr_amount = false
break
end
end
for _, pl_data in pairs(arena.players) do
if not pl_data.teamID then
-- prima ripartisco fino a raggiungere max_curr_amount su tutte le squadre..
if not all_max_curr_amount then
for teamID, amount in pairs(arena.players_amount_per_team) do
if amount < max_curr_amount then
pl_data.teamID = teamID