From: terencehill Date: Mon, 22 Aug 2016 20:23:07 +0000 (+0200) Subject: Don't draw scoreboard and HUD until gametype and scores have been received received... X-Git-Tag: xonotic-v0.8.2~679^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F362%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Don't draw scoreboard and HUD until gametype and scores have been received received, fixes many issues on connection --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 22be8b195..6f70c47fd 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index d49548084..1211debf8 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 222620052..c4928196c 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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)) {