]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
A small change
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 17:23:35 +0000 (19:23 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 17:23:35 +0000 (19:23 +0200)
qcsrc/server/cl_weaponsystem.qc

index c04bbd25776393277fdd44ecada1389069073cbb..e55b3a4ff80c1bd0bd0f1257da1a1d85530573f1 100644 (file)
@@ -1614,17 +1614,17 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 
 void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
 {
-       // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+               return;
+
+       // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+       if(ammo_reload)
        {
-               if(ammo_reload)
-               {
-                       self.clip_load -= ammo_use;
-                       self.weapon_load[self.weapon] = self.clip_load;
-               }
-               else
-                       self.(self.current_ammo) -= ammo_use;
+               self.clip_load -= ammo_use;
+               self.weapon_load[self.weapon] = self.clip_load;
        }
+       else
+               self.(self.current_ammo) -= ammo_use;
 }
 
 // weapon reloading code