From: Mario Date: Sat, 1 Jul 2017 04:12:37 +0000 (+1000) Subject: Workaround for admins who change g_maxplayers mid match (count the actual players... X-Git-Tag: xonotic-v0.8.5~2669 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f16c95a1e2c5b13ba3e7bd11eed191493afa801f;p=xonotic%2Fxonotic-data.pk3dir.git Workaround for admins who change g_maxplayers mid match (count the actual players before marking it as duel) --- diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 7f31e20d3..2342af6d9 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -260,7 +260,15 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that // this... is a hack, a temporary one until we get a proper duel gametype string PlayerStats_GetGametype() { - return ((IS_GAMETYPE(DEATHMATCH) && autocvar_g_maxplayers == 2) ? "duel" : GetGametype()); + if(IS_GAMETYPE(DEATHMATCH) && autocvar_g_maxplayers == 2) + { + // probably duel, but let's make sure + int plcount = 0; + FOREACH_CLIENT(IS_PLAYER(it), ++plcount); + if(plcount <= 2) + return "duel"; + } + return GetGametype(); } void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)