]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't adjust player alpha for the invisibility powerup while inside a vehicle, fixes...
authorMario <mario.mario@y7mail.com>
Fri, 12 Jun 2020 01:59:35 +0000 (11:59 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 12 Jun 2020 01:59:48 +0000 (11:59 +1000)
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc

index 0e0716dd1805263c9eeb7b715bd979c3b91a00d0..0bcea98859761b486ae336d17925cbece69b29ad 100644 (file)
@@ -235,8 +235,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups)
                play_countdown(player, STAT(STRENGTH_FINISHED, player), SND_POWEROFF);
                if (time > STAT(STRENGTH_FINISHED, player))
                {
-                       player.alpha = default_player_alpha;
-                       player.exteriorweaponentity.alpha = default_weapon_alpha;
+                       if(!this.vehicle) // already reset upon exit
+                       {
+                               player.alpha = default_player_alpha;
+                               player.exteriorweaponentity.alpha = default_weapon_alpha;
+                       }
                        player.items &= ~ITEM_Invisibility.m_itemid;
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
                }
@@ -245,8 +248,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups)
        {
                if (time < STAT(STRENGTH_FINISHED, player))
                {
-                       player.alpha = autocvar_g_instagib_invis_alpha;
-                       player.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
+                       if(!this.vehicle) // incase the player is given powerups while inside a vehicle
+                       {
+                               player.alpha = autocvar_g_instagib_invis_alpha;
+                               player.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
+                       }
                        player.items |= ITEM_Invisibility.m_itemid;
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname);
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);