]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
Fix Windows-specific use-after-free causing crash after disconnecting
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index 40261c677c71829d4d9e99ab8ffd1bc341b161af..010925b7b6bf81cb63eb80c86dc55d3957b7917f 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -357,8 +357,11 @@ static void sbar_newmap(void)
 
 void Sbar_Init (void)
 {
-       Cmd_AddCommand(&cmd_client, "+showscores", Sbar_ShowScores_f, "show scoreboard");
-       Cmd_AddCommand(&cmd_client, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
+       if(gamemode == GAME_NORMAL) // Workaround so Quake doesn't trample on Xonotic.
+       {
+               Cmd_AddCommand(&cmd_client, "+showscores", Sbar_ShowScores_f, "show scoreboard");
+               Cmd_AddCommand(&cmd_client, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
+       }
        Cvar_RegisterVariable(&showfps);
        Cvar_RegisterVariable(&showsound);
        Cvar_RegisterVariable(&showblur);