]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure we can / need to reload before checking if we have enough ammo to
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 16:11:19 +0000 (18:11 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 16:11:19 +0000 (18:11 +0200)
qcsrc/server/cl_weaponsystem.qc

index 1babd2108e5498c25a6ca37a5d4eb126164d11fd..faf18b8daefa64f0e646a19a1dd85fa16022ebb2 100644 (file)
@@ -1632,6 +1632,11 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 
 float W_ReloadCheck(float ammo_amount)
 {
+       entity e;
+       e = get_weaponinfo(self.weapon);
+       if (self.ammo_counter >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+               return 0;
+
        if(!ammo_amount) // when we get here, ammo_counter must be 0 or -1
        {
                print("cannot reload... not enough ammo\n");
@@ -1640,11 +1645,6 @@ float W_ReloadCheck(float ammo_amount)
                return 0;
        }
 
-       entity e;
-       e = get_weaponinfo(self.weapon);
-       if (self.ammo_counter >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
-               return 0;
-
        if (self.weaponentity)
        {
                if (self.weaponentity.wframe == WFRAME_RELOAD)