From: terencehill Date: Tue, 30 Apr 2013 22:26:29 +0000 (+0200) Subject: Update immediately HUD color when changing team X-Git-Tag: xonotic-v0.7.0~62^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c87bab8aeff864b23971408ba1349a5cf730edf;p=xonotic%2Fxonotic-data.pk3dir.git Update immediately HUD color when changing team --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 4f00c5534..e7e7f9059 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -384,6 +384,7 @@ float checkfail[16]; #define BUTTON_3 4 #define BUTTON_4 8 float cl_notice_run(); +float prev_myteam; void CSQC_UpdateView(float w, float h) { entity e; @@ -442,6 +443,13 @@ void CSQC_UpdateView(float w, float h) #endif myteam = GetPlayerColor(player_localentnum - 1); + if(myteam != prev_myteam) + { + for(i = 0; i < HUD_PANEL_NUM; ++i) + hud_panel[i].update_time = time; + prev_myteam = myteam; + } + ticrate = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE); float is_dead = (getstati(STAT_HEALTH) <= 0); diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 28314884d..e2dd7ea82 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -318,7 +318,7 @@ else\ // NOTE: in hud_configure mode cvars must be reloaded every frame #define HUD_Panel_UpdateCvars() \ -if(panel.update_time < time) { \ +if(panel.update_time <= time) { \ if(autocvar__hud_configure) panel_enabled = cvar(strcat("hud_panel_", panel.panel_name)); \ panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \ panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size"))); \