]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix shotgun reloading
authorMario <mario.mario@y7mail.com>
Fri, 13 Dec 2013 01:29:40 +0000 (12:29 +1100)
committerMario <mario.mario@y7mail.com>
Fri, 13 Dec 2013 01:29:40 +0000 (12:29 +1100)
qcsrc/common/weapons/w_shotgun.qc
qcsrc/server/weapons/weaponsystem.qc

index c00d678ecf1a60ccc23552d57a0868e18294f6c4..31adb4a8bac30bc3c1cc4078b197c29ebef45a97 100644 (file)
@@ -205,7 +205,7 @@ float w_shotgun(float req)
                        if(WEP_CVAR(shotgun, reload_ammo) && self.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload
                        {
                                // don't force reload an empty shotgun if its melee attack is active
-                               if (!(WEP_CVAR(shotgun, secondary) && self.ammo_shells < WEP_CVAR_PRI(shotgun, ammo)))
+                               if (!WEP_CVAR(shotgun, secondary))
                                        WEP_ACTION(self.weapon, WR_RELOAD);
                        }
                        else
index 593919ec0548fa6842581a52fd3fc4513590c414..e5145927d50ee1958f77bf368c1084a818026158 100644 (file)
@@ -839,7 +839,7 @@ void W_ReloadedAndReady()
        self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
 
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
-       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO)
+       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.current_ammo == ammo_none)
                self.clip_load = self.reload_ammo_amount;
        else
        {
@@ -887,6 +887,7 @@ void W_Reload(float sent_ammo_min, string sent_sound)
                return;
 
        // no ammo, so nothing to load
+       if(self.current_ammo != ammo_none)
        if(!self.(self.current_ammo) && self.reload_ammo_min)
        if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {