From: terencehill Date: Tue, 2 Dec 2014 17:15:39 +0000 (+0100) Subject: In the first frame set up a temporary scoreboard layout just to get rid of some conso... X-Git-Tag: xonotic-v0.8.0~130^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=54e114cd8c279676d23ac9066d508222ff0a5c35;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 4110d6d16..809802dff 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 58583a0ea..337a63e04 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), " ");