]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
w only t_items.qc is still evil
authorRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 16:01:43 +0000 (17:01 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 16:01:43 +0000 (17:01 +0100)
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_nix.qc

index cf4c5e16a7c2a6b7f09248ff1443cbfb799ed3bb..48f9b5c199f423523ded455d31217b056d00ac16 100644 (file)
@@ -918,7 +918,7 @@ void readplayerstartcvars()
                {
                        e = get_weaponinfo(i);
                        if(want_weapon("g_start_weapon_", e, FALSE))
-                               WEPSET_OR_AW(start_weapons, e.weapons);
+                               WEPSET_OR_AW(start_weapons, i);
                }
        }
 
@@ -992,7 +992,7 @@ void readplayerstartcvars()
                        {
                                e = get_weaponinfo(i);
                                if(want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns")))
-                                       WEPSET_OR_AW(warmup_start_weapons, j);
+                                       WEPSET_OR_AW(warmup_start_weapons, i);
                        }
                }
        }
index fd1a8fb591879f5a3152c9de6da99292eb1e343b..85d0efefbc400ddfefdc580e1304332af5a52c96 100644 (file)
@@ -139,7 +139,7 @@ void GiveBall(entity plyr, entity ball)
        
     ownr = self;
     self = plyr;    
-    self.weaponentity.weapons = self.weapons;
+    WEPSET_COPY_EE(self.weaponentity, self);
     self.weaponentity.switchweapon = self.weapon;
     WEPSET_COPY_EW(self, WEP_PORTO);
     weapon_action(WEP_PORTO, WR_RESETPLAYER);
@@ -921,14 +921,14 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
         }
         else
         {            
-            if(self.weaponentity.weapons)
+            if(!WEPSET_EMPTY_E(self.weaponentity))
             {
-                self.weapons = self.weaponentity.weapons;        
+                WEPSET_COPY_EE(self, self.weaponentity);
                 weapon_action(WEP_PORTO, WR_RESETPLAYER);
                 self.switchweapon = self.weaponentity.switchweapon;
                 W_SwitchWeapon(self.switchweapon);
                 
-                self.weaponentity.weapons = 0;
+               WEPSET_CLEAR_E(self.weaponentity);
             }
         }
         
@@ -938,7 +938,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
 {    
-    self.weaponentity.weapons = 0;
+    WEPSET_CLEAR_E(self.weaponentity);
     
     if(nexball_mode & NBM_BASKETBALL)
         WEPSET_OR_EW(self, WEP_PORTO);
index 45aa9d14b09ad798a8b57c087471fd2c4d1863f0..76e779c5a5f2c76614ad44f520d464ed2e95d4e1 100644 (file)
@@ -13,11 +13,11 @@ float NIX_CanChooseWeapon(float wpn)
 {
        entity e;
        e = get_weaponinfo(wpn);
-       if(!e.weapons) // skip dummies
+       if(!e.weapon) // skip dummies
                return FALSE;
        if(g_weaponarena)
        {
-               if not(g_weaponarena & e.weapons)
+               if not(WEPSET_CONTAINS_AW(g_weaponarena_weapons, wpn))
                        return FALSE;
        }
        else
@@ -134,7 +134,7 @@ void NIX_GiveCurrentWeapon()
                self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
        }
 
-       self.weapons = 0;
+       WEPSET_CLEAR_E(self);
        if(g_nix_with_laser)
                WEPSET_ANDNOT_EW(self, WEP_LASER);
        WEPSET_OR_EW(self, nix_weapon);