]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a few weapons not working with 0 ammo while owning the unlimited ammo powerup
authorterencehill <piuntn@gmail.com>
Fri, 6 Feb 2015 20:51:31 +0000 (21:51 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 6 Feb 2015 20:51:31 +0000 (21:51 +0100)
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_hagar.qc

index d8faa7be97daead90da13c9ab84dbcd7e23a89c0..5176af6c725245a221ef87ff1a2a541b045770f6 100644 (file)
@@ -272,6 +272,7 @@ void W_Arc_Beam_Think(void)
                entity oldself = self;
                self = self.owner;
                if(!WEP_ACTION(WEP_ARC, WR_CHECKAMMO1) && !WEP_ACTION(WEP_ARC, WR_CHECKAMMO2))
+               if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        // note: this doesn't force the switch
                        W_SwitchToOtherWeapon(self);
index 9e5f98a492033c49f1121aa6f72ce30e0793a8b5..ab334fafb8e51c37a736221a5ebe44f4ce346916 100644 (file)
@@ -103,6 +103,7 @@ void W_Devastator_Explode(void)
        if(self.realowner.weapon == WEP_DEVASTATOR)
        {
                if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
+               if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        self.realowner.cnt = WEP_DEVASTATOR;
                        ATTACK_FINISHED(self.realowner) = time;
@@ -181,6 +182,7 @@ void W_Devastator_DoRemoteExplode(void)
        if(self.realowner.weapon == WEP_DEVASTATOR)
        {
                if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
+               if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        self.realowner.cnt = WEP_DEVASTATOR;
                        ATTACK_FINISHED(self.realowner) = time;
index 1085c315afae03ef3992de648a29ad3c48344097..62b52168e62c1894b1922ee82c412658d84ccb31 100644 (file)
@@ -299,7 +299,9 @@ void W_Hagar_Attack2_Load(void)
        loaded = self.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
 
        // this is different than WR_CHECKAMMO when it comes to reloading
-       if(autocvar_g_balance_hagar_reload_ammo)
+       if(self.items & IT_UNLIMITED_WEAPON_AMMO)
+               enough_ammo = true;
+       else if(autocvar_g_balance_hagar_reload_ammo)
                enough_ammo = self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
        else
                enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
@@ -383,6 +385,7 @@ void W_Hagar_Attack2_Load(void)
 
        // we aren't checking ammo during an attack, so we must do it here
        if(!(WEP_ACTION(self.weapon, WR_CHECKAMMO1) + WEP_ACTION(self.weapon, WR_CHECKAMMO2)))
+       if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                // note: this doesn't force the switch
                W_SwitchToOtherWeapon(self);