From f16c95a1e2c5b13ba3e7bd11eed191493afa801f Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 1 Jul 2017 14:12:37 +1000 Subject: [PATCH 1/1] Workaround for admins who change g_maxplayers mid match (count the actual players before marking it as duel) --- qcsrc/common/playerstats.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 7f31e20d31..2342af6d97 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) -- 2.39.2