Update immediately HUD color when changing team
authorterencehill <piuntn@gmail.com>
Tue, 30 Apr 2013 22:26:29 +0000 (00:26 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 30 Apr 2013 22:26:29 +0000 (00:26 +0200)
qcsrc/client/View.qc
qcsrc/client/hud.qh

index 4f00c55341639fbce6fd13122c29384a1db910b6..e7e7f9059509ba46139c54a3230ec9801bb3cea6 100644 (file)
@@ -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);
index 28314884d6422f186e88c300c0c1f7e275c7dbbe..e2dd7ea82e0e9c097744fc4c55ea6a80adfbb134 100644 (file)
@@ -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"))); \