]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nix/nix.qc
Merge branch 'master' into morphed/hagar
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nix / nix.qc
index 2f4a7cd6390c0637387eab286c39347b531f3710..d265d33185acfd7536e628e80be57903524eda3c 100644 (file)
@@ -54,19 +54,17 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill"
        MUTATOR_ONREMOVE
        {
                // as the PlayerSpawn hook will no longer run, NIX is turned off by this!
-               entity e;
-               FOR_EACH_PLAYER(e) if(e.deadflag == DEAD_NO)
-               {
-                       e.ammo_cells = start_ammo_cells;
-                       e.ammo_plasma = start_ammo_plasma;
-                       e.ammo_shells = start_ammo_shells;
-                       e.ammo_nails = start_ammo_nails;
-                       e.ammo_rockets = start_ammo_rockets;
-                       e.ammo_fuel = start_ammo_fuel;
-                       e.weapons = start_weapons;
-                       if(!client_hasweapon(e, PS(e).m_weapon, true, false))
-                               PS(e).m_switchweapon = w_getbestweapon(self);
-               }
+               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
+                       it.ammo_cells = start_ammo_cells;
+                       it.ammo_plasma = start_ammo_plasma;
+                       it.ammo_shells = start_ammo_shells;
+                       it.ammo_nails = start_ammo_nails;
+                       it.ammo_rockets = start_ammo_rockets;
+                       it.ammo_fuel = start_ammo_fuel;
+                       it.weapons = start_weapons;
+                       if(!client_hasweapon(it, PS(it).m_weapon, true, false))
+                               PS(it).m_switchweapon = w_getbestweapon(self);
+               ));
        }
 
        return 0;
@@ -266,7 +264,7 @@ MUTATOR_HOOKFUNCTION(nix, OnEntityPreSpawn)
 MUTATOR_HOOKFUNCTION(nix, PlayerPreThink)
 {SELFPARAM();
        if(!intermission_running)
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        if(IS_PLAYER(self))
                NIX_GiveCurrentWeapon();
        return 0;