From 54e114cd8c279676d23ac9066d508222ff0a5c35 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 2 Dec 2014 18:15:39 +0100 Subject: [PATCH] In the first frame set up a temporary scoreboard layout just to get rid of some console warnings in certain gamemodes (e.g. dm). This is because initially no layout can be properly set up until score_info data haven't been received. --- qcsrc/client/Main.qc | 4 ++-- qcsrc/client/scoreboard.qc | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 4110d6d161..809802dff1 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -96,6 +96,8 @@ void CSQC_Init(void) for(i = 0; i < MAX_HUD_FIELDS; ++i) hud_title[i] = strzone("(null)"); + Cmd_HUD_SetFields(0); + postinit = false; calledhooks = 0; @@ -316,8 +318,6 @@ void Porto_Init(); void TrueAim_Init(); void PostInit(void) { - localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n")); - entity playerchecker; playerchecker = spawn(); playerchecker.think = Playerchecker_Think; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 58583a0eab..337a63e04f 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -304,6 +304,16 @@ void Cmd_HUD_SetFields(float argc) float have_name = 0, have_primary = 0, have_secondary = 0, have_separator = 0; 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 = 0; + scores_label[ps_primary] = strzone("score"); + scores_flags[ps_primary] = SFL_ALLOW_HIDE; + } + // TODO: re enable with gametype dependant cvars? if(argc < 3) // no arguments provided argc = tokenizebyseparator(strcat("0 1 ", autocvar_scoreboard_columns), " "); -- 2.39.2