]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Add reboot time for the HUD
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 20:25:37 +0000 (22:25 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 20:25:37 +0000 (22:25 +0200)
data/qcsrc/client/sbar.qc

index a4f03db837ec4c4ce30dc3b318c81e634b323ad9..ec49dc45a94e639bf99738d75b78dd20cac436fa 100644 (file)
@@ -2784,6 +2784,8 @@ float vote_prev; // previous state of vote_active to check for a change
 float vote_alpha;\r
 float vote_change; // "time" when vote_active changed\r
 \r
+float power_boot;\r
+\r
 vector stomachstatus_colorfade_current;\r
 vector StomachStatus_ColorFade(vector target_color)\r
 {\r
@@ -3079,16 +3081,22 @@ void Sbar_Draw (void)
                fade = bound(0.7, fade, 1);\r
 \r
                if(getstati(STAT_HEALTH) > 0)\r
-               if(getstati(STAT_ARMOR) < g_power)\r
                {\r
-                       vector warn_pos;\r
-                       warn_pos_x = vid_conwidth / 2;\r
-                       warn_pos_y = vid_conheight - vid_conheight / 2.5;\r
-\r
-                       drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL);\r
+                       if(getstati(STAT_ARMOR) < g_power)\r
+                       {\r
+                               vector warn_pos;\r
+                               warn_pos_x = vid_conwidth / 2;\r
+                               warn_pos_y = vid_conheight - vid_conheight / 2.5;\r
+                               drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL);\r
 \r
-                       return;\r
+                               power_boot = time + g_power_reboot;\r
+                               return;\r
+                       }\r
+                       else if(time < power_boot)\r
+                       {\r
+                               return;\r
+                       }\r
                }\r
 \r
                if(g_vore) // only when the vore system is active\r