Merge branch 'master' into terencehill/unlimited_ammo_fixes
authorterencehill <piuntn@gmail.com>
Sun, 5 Apr 2015 22:54:48 +0000 (00:54 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 5 Apr 2015 22:54:48 +0000 (00:54 +0200)
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_hagar.qc

index d8faa7b..5176af6 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 9e5f98a..ab334fa 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 1085c31..62b5216 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);