e.weapons = result;
}
+string GetAmmoPicture(.float ammotype)
+{
+ switch(ammotype)
+ {
+ case ammo_shells: return "ammo_shells";
+ case ammo_nails: return "ammo_nails";
+ case ammo_rockets: return "ammo_rockets";
+ case ammo_cells: return "ammo_cells";
+ case ammo_fuel: return "ammo_fuel";
+ default: return ""; // wtf, no ammo type?
+ }
+}
+
#ifdef CSQC
.float GetAmmoFieldFromNum(float i)
{
}
}
-string GetAmmoPicture(.float ammotype)
-{
- switch(ammotype)
- {
- case ammo_shells: return "ammo_shells";
- case ammo_nails: return "ammo_nails";
- case ammo_rockets: return "ammo_rockets";
- case ammo_cells: return "ammo_cells";
- case ammo_fuel: return "ammo_fuel";
- default: return ""; // wtf, no ammo type?
- }
-}
-
float GetAmmoStat(.float ammotype)
{
switch(ammotype)
string W_FixWeaponOrder_ForceComplete(string order);
void W_RandomWeapons(entity e, float n);
+string GetAmmoPicture(.float ammotype);
+
#ifdef CSQC
.float GetAmmoFieldFromNum(float i);
-string GetAmmoPicture(.float ammotype);
float GetAmmoStat(.float ammotype);
#endif
self.(weapon_load[self.weapon]) = self.clip_load;
}
else
+ {
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