]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix up the handling of invisibility buff, so as to not interfere much with the invisi...
authorMario <mario@smbclan.net>
Sat, 4 Feb 2017 14:23:45 +0000 (00:23 +1000)
committerMario <mario@smbclan.net>
Sat, 4 Feb 2017 14:23:45 +0000 (00:23 +1000)
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc

index 87232ebc01476d31a5ab7a0cf6ca1f6373f48b97..a9dd6574d1c9e48d03cd7113ec70fdbb8d4c7ae0 100644 (file)
@@ -932,14 +932,19 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
                BUFF_ONADD(BUFF_INVISIBLE)
                {
                        if(time < player.strength_finished && g_instagib)
-                               player.alpha = autocvar_g_instagib_invis_alpha;
+                               player.buff_invisible_prev_alpha = default_player_alpha; // we don't want to save the powerup's alpha, as player may lose the powerup while holding the buff
                        else
-                               player.alpha = player.buff_invisible_prev_alpha;
+                               player.buff_invisible_prev_alpha = player.alpha;
                        player.alpha = autocvar_g_buffs_invisible_alpha;
                }
 
                BUFF_ONREM(BUFF_INVISIBLE)
-                       player.alpha = player.buff_invisible_prev_alpha;
+               {
+                       if(time < player.strength_finished && g_instagib)
+                               player.alpha = autocvar_g_instagib_invis_alpha;
+                       else
+                               player.alpha = player.buff_invisible_prev_alpha;
+               }
 
                BUFF_ONADD(BUFF_FLIGHT)
                {