]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't shake the hud when changing spectated player
authorterencehill <piuntn@gmail.com>
Sat, 11 Jun 2016 22:16:20 +0000 (00:16 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 11 Jun 2016 22:16:20 +0000 (00:16 +0200)
qcsrc/client/hud/hud.qc

index c87cb5a89cd853e3561826106d9b31fd2dd4ac2c..ee1000755cb3c0b90ab4fd6ebe4376c1ee02a675 100644 (file)
@@ -446,12 +446,15 @@ void Hud_Dynamic_Frame()
 
        if(autocvar_hud_dynamic_shake > 0)
        {
+               static float old_health = 0;
+               float health = max(-1, STAT(HEALTH));
                if(hud_dynamic_shake_factor == -1) // don't allow the effect for this frame
+               {
                        hud_dynamic_shake_factor = 0;
+                       old_health = health;
+               }
                else
                {
-                       static float old_health = 0;
-                       float health = max(-1, STAT(HEALTH));
                        float new_hud_dynamic_shake_factor = 0;
                        if (old_health - health >= autocvar_hud_dynamic_shake_damage_min
                                && autocvar_hud_dynamic_shake_damage_max > autocvar_hud_dynamic_shake_damage_min