]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't draw scoreboard and HUD until gametype and scores have been received received... 362/head
authorterencehill <piuntn@gmail.com>
Mon, 22 Aug 2016 20:23:07 +0000 (22:23 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 22 Aug 2016 20:23:07 +0000 (22:23 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/client/view.qc

index 22be8b195c34076ec706b9f3680f14d114210605..6f70c47fd745ed4ee9a0cc40d6e8d4e4fbfb7a81 100644 (file)
@@ -359,15 +359,12 @@ void Cmd_Scoreboard_SetFields(int argc)
        float missing;
 
        if(!gametype)
-       {
-               // set up a temporary scoreboard layout
-               // no layout can be properly set up until score_info data haven't been received
-               argc = tokenizebyseparator("0 1 ping pl name | score", " ");
-               ps_primary = SP_SCORE;
-               ps_secondary = SP_SCORE;
-               scores_label(ps_primary) = strzone("score");
-               scores_flags(ps_primary) = SFL_ALLOW_HIDE;
-       }
+               return; // do nothing, we don't know gametype and scores yet
+
+       // sbt_fields uses strunzone on the titles!
+       if(!sbt_field_title[0])
+               for(i = 0; i < MAX_SBT_FIELDS; ++i)
+                       sbt_field_title[i] = strzone("(null)");
 
        // TODO: re enable with gametype dependant cvars?
        if(argc < 3) // no arguments provided
index d49548084a3e04726242bff8bfafd36f63c42daf..1211debf8753c5b17bd6b4d1a21a79ef404f5c98 100644 (file)
@@ -132,12 +132,6 @@ void CSQC_Init()
 
        gametype = NULL;
 
-       // sbt_fields uses strunzone on the titles!
-       for(int i = 0; i < MAX_SBT_FIELDS; ++i)
-               sbt_field_title[i] = strzone("(null)");
-
-       Cmd_Scoreboard_SetFields(0);
-
        postinit = false;
 
        calledhooks = 0;
index 2226200521e27683e51cc5f640324be655ce447c..c4928196c3e237a4b6e5f124bf5f4abd87b7065c 100644 (file)
@@ -1322,6 +1322,13 @@ void HUD_Crosshair(entity this)
 
 void HUD_Draw(entity this)
 {
+       // if we don't know gametype and scores yet avoid drawing the scoreboard
+       // also in the very first frames, player state may be inconsistent so avoid drawing the hud at all
+       // e.g. since initial player's health is 0 hud would display the hud_damage effect,
+       // cl_deathscoreboard would show the scoreboard and so on
+       if(!gametype)
+               return;
+
        if(!intermission)
        if (MUTATOR_CALLHOOK(HUD_Draw_overlay))
        {