]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
Merge branch 'terencehill/cl_forceplayercolors_3' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / sv_instagib.qc
index 272680fb20351adf6de41097db683967036ce2e2..a23fc36970a6822f5ca48af79b29487c338a5df5 100644 (file)
@@ -179,7 +179,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn)
        entity mon = M_ARGV(0, entity);
 
        // always refill ammo
-       if(mon.monsterid == MON_MAGE.monsterid)
+       if(mon.monsterdef == MON_MAGE)
                mon.skin = 1;
 }
 
@@ -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(!player.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(!player.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);
@@ -255,8 +261,8 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups)
 
        if (player.items & ITEM_Speed.m_itemid)
        {
-               play_countdown(player, player.invincible_finished, SND_POWEROFF);
-               if (time > player.invincible_finished)
+               play_countdown(player, STAT(INVINCIBLE_FINISHED, player), SND_POWEROFF);
+               if (time > STAT(INVINCIBLE_FINISHED, player))
                {
                        player.items &= ~ITEM_Speed.m_itemid;
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERDOWN_SPEED);
@@ -264,7 +270,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups)
        }
        else
        {
-               if (time < player.invincible_finished)
+               if (time < STAT(INVINCIBLE_FINISHED, player))
                {
                        player.items |= ITEM_Speed.m_itemid;
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SPEED, player.netname);