]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_weaponsystem.qc
Some bugfixes from Xonotic, regarding features I ported in VT
[voretournament/voretournament.git] / data / qcsrc / server / cl_weaponsystem.qc
index b2706ecd34c002cc9f009ec618dbffd3a0080e7e..10fef523f2e5669572e7619c2c792071945b0478 100644 (file)
@@ -1574,15 +1574,14 @@ 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\r
 \r
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load\r
-       if(!self.reload_ammo_min)\r
+       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO)\r
                self.clip_load = self.reload_ammo_amount;\r
        else\r
        {\r
                while(self.clip_load < self.reload_ammo_amount && self.(self.current_ammo)) // make sure we don't add more ammo than we have\r
                {\r
                        self.clip_load += 1;\r
-                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
-                               self.(self.current_ammo) -= 1;\r
+                       self.(self.current_ammo) -= 1;\r
                }\r
        }\r
        self.weapon_load[self.weapon] = self.clip_load;\r
@@ -1626,6 +1625,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
 \r
        // no ammo, so nothing to load\r
        if(!self.(self.current_ammo) && self.reload_ammo_min)\r
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
        {\r
                if(clienttype(self) == CLIENTTYPE_REAL && self.reload_complain < time)\r
                {\r