]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Workaround for admins who change g_maxplayers mid match (count the actual players...
authorMario <mario@smbclan.net>
Sat, 1 Jul 2017 04:12:37 +0000 (14:12 +1000)
committerMario <mario@smbclan.net>
Sat, 1 Jul 2017 04:12:56 +0000 (14:12 +1000)
qcsrc/common/playerstats.qc

index 7f31e20d311746958f80082fababa2a9e01ab253..2342af6d978abb79c1d29e2d648e0c192ee294d0 100644 (file)
@@ -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)