]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_nexball.qc
Merge remote branch 'origin/master' into samual/mutator_ctf
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_nexball.qc
index c27c466a6a69057cc607eb9dc413deb36eb2aa04..9d7870acab004c0610f65c32fc9ed54ceb71a777 100644 (file)
@@ -139,9 +139,9 @@ 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;
-    self.weapons = W_WeaponBit(WEP_PORTO);      
+    WEPSET_COPY_EW(self, WEP_PORTO);
     weapon_action(WEP_PORTO, WR_RESETPLAYER);
     self.switchweapon = WEP_PORTO;
     W_SwitchWeapon(WEP_PORTO);
@@ -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,12 +938,12 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
 {    
-    self.weaponentity.weapons = 0;
+    WEPSET_CLEAR_E(self.weaponentity);
     
     if(nexball_mode & NBM_BASKETBALL)
-        self.weapons |= W_WeaponBit(WEP_PORTO);
+        WEPSET_OR_EW(self, WEP_PORTO);
     else
-        self.weapons = 0; //    W_WeaponBit(WEP_PORTO);
+        WEPSET_CLEAR_E(self);
 
     return FALSE;
 }