]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/instagib.qc
Merge branch 'terencehill/menu_optimization' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / instagib.qc
index 6f35817149af1fc753a52b9691d95c5c93721d14..640e3d5b61cdd83ecc2505b9115cbc9773be3e80 100644 (file)
@@ -16,9 +16,9 @@ int autocvar_g_instagib_ammo_drop;
 int autocvar_g_instagib_extralives;
 float autocvar_g_instagib_speed_highspeed;
 
-#include "../../../../server/cl_client.qh"
+#include <server/cl_client.qh>
 
-#include "../../../items/all.qc"
+#include <common/items/all.qc>
 
 REGISTER_MUTATOR(mutator_instagib, cvar("g_instagib") && !g_nexball);
 
@@ -62,7 +62,7 @@ void instagib_ammocheck()
        if(!IS_PLAYER(self))
                return; // not a player
 
-       if(self.deadflag || gameover)
+       if(IS_DEAD(self) || gameover)
                instagib_stop_countdown(self);
        else if (self.ammo_cells > 0 || (self.items & IT_UNLIMITED_WEAPON_AMMO) || (self.flags & FL_GODMODE))
                instagib_stop_countdown(self);
@@ -139,10 +139,7 @@ void instagib_ammocheck()
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, MatchEnd)
 {
-       entity head;
-       FOR_EACH_PLAYER(head)
-               instagib_stop_countdown(head);
-
+       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(instagib_stop_countdown(it)));
        return false;
 }
 
@@ -408,7 +405,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies)
        if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                frag_damage = 1000; // always gib if it was a vaporizer death
 
-       return FALSE;
+       return false;
 }
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch)