Ensure average players stat is never more than max player count.

master
Nathan Salapat 2022-05-02 20:09:09 -05:00
parent e84d73dbdc
commit 78f9087c4f
1 changed files with 4 additions and 1 deletions

View File

@ -40,8 +40,11 @@ function lobby.retrieve_stats(map_id)
local traitor = stats.winner_traitor
local team = stats.winner_team
local avg_players = stats.player_count
local avg = string.format("%.2f", avg_players)
local max = stats.max_players or 0
if avg_players > max then
avg_players = max
end
local avg = string.format("%.2f", avg_players)
formspec =
'formspec_version[3]'..
'size[16,9]'..