]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Remove the stomach splash effect at respawn
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Feb 2011 23:12:30 +0000 (01:12 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Feb 2011 23:12:30 +0000 (01:12 +0200)
data/qcsrc/client/View.qc

index f221da7f3a246f657735ce48951248efb806223d..0045ac9da277d8ac05a1e239068192896a10d47b 100644 (file)
@@ -255,7 +255,7 @@ float artwork_fade;
 float pickup_crosshair_time, pickup_crosshair_size;\r
 float myhealth, myhealth_prev, myhealth_flash;\r
 float contentavgalpha, liquidalpha_prev;\r
-float stomachsplash_alpha;\r
+float stomachsplash_alpha, stomachsplash_remove_at_respawn;\r
 vector myhealth_gentlergb;\r
 vector liquidcolor_prev;\r
 vector damage_blurpostprocess, content_blurpostprocess;\r
@@ -607,6 +607,12 @@ void CSQC_UpdateView(float w, float h)
                        else\r
                                stomachsplash_alpha = 0;\r
                }\r
+               if (getstati(STAT_HEALTH) <= 0)\r
+                       stomachsplash_remove_at_respawn = 1; // schedule the effect to be removed next respawn\r
+\r
+               if(getstati(STAT_HEALTH) > 0 && stomachsplash_remove_at_respawn)\r
+                       stomachsplash_alpha = stomachsplash_remove_at_respawn = 0; // we respawned, remove the effect\r
+\r
                stomachsplash_alpha = bound(0, stomachsplash_alpha, 1);\r
                drawpic('0 0 0', "gfx/food", '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, stov(cvar_string("hud_stomach_color")), stomachsplash_alpha, DRAWFLAG_NORMAL);\r
        }\r