]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
yayyyy the client side tracing now works quite decently! :D
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index e99c450ec0a64fdf6192135e306eb781bb3f3364..7c8ce3511f3d28a7dab2bb8df555834e03ca58f7 100644 (file)
@@ -812,8 +812,22 @@ void W_DecreaseAmmo(float ammo_use)
                self.clip_load -= ammo_use;
                self.(weapon_load[self.weapon]) = self.clip_load;
        }
-       else
+       else if(wep.ammo_field != ammo_none)
+       {
                self.(wep.ammo_field) -= ammo_use;
+               if(self.(wep.ammo_field) < 0)
+               {
+                       backtrace(sprintf(
+                               "W_DecreaseAmmo(%.2f): '%s' subtracted too much %s from '%s', resulting with '%.2f' left... "
+                               "Please notify Samual immediately with a copy of this backtrace!\n",
+                               ammo_use,
+                               wep.netname,
+                               GetAmmoPicture(wep.ammo_field),
+                               self.netname,
+                               self.(wep.ammo_field)
+                       ));
+               }
+       }
 }
 
 // weapon reloading code