]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_nix.qc
Merge branch 'Mario/spawnsystem_mutator' into Mario/overkill
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_nix.qc
index d5f95bd3039465f4df277b7ec389f6909a37c549..4a11e564bdd18990915c7a9f602f9bad6bf597e2 100644 (file)
@@ -17,7 +17,7 @@ float NIX_CanChooseWeapon(float wpn)
                return FALSE;
        if(g_weaponarena)
        {
-               if not(WEPSET_CONTAINS_AW(g_weaponarena_weapons, wpn))
+               if(!(g_weaponarena_weapons & WepSet_FromWeapon(wpn)))
                        return FALSE;
        }
        else
@@ -136,10 +136,10 @@ void NIX_GiveCurrentWeapon()
                self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
        }
 
-       WEPSET_CLEAR_E(self);
+       self.weapons = '0 0 0';
        if(g_nix_with_laser)
-               WEPSET_ANDNOT_EW(self, WEP_LASER);
-       WEPSET_OR_EW(self, nix_weapon);
+               self.weapons &= ~WEPSET_LASER;
+       self.weapons |= WepSet_FromWeapon(nix_weapon);
 
        if(self.switchweapon != nix_weapon)
                if(!client_hasweapon(self, self.switchweapon, TRUE, FALSE))
@@ -205,7 +205,7 @@ MUTATOR_HOOKFUNCTION(nix_PlayerPreThink)
 {
        if(!intermission_running)
        if(self.deadflag == DEAD_NO)
-       if(self.classname == "player")
+       if(IS_PLAYER(self))
                NIX_GiveCurrentWeapon();
        return 0;
 }
@@ -263,7 +263,7 @@ MUTATOR_DEFINITION(mutator_nix)
                        e.ammo_nails = start_ammo_nails;
                        e.ammo_rockets = start_ammo_rockets;
                        e.ammo_fuel = start_ammo_fuel;
-                       WEPSET_COPY_EA(e, start_weapons);
+                       e.weapons = start_weapons;
                        if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
                                e.switchweapon = w_getbestweapon(self);
                }