}
}
+#ifdef SVQC
+int GetAmmoConsumptionPrimary(string netname)
+// Returns ammo consumed per shot by the primary/default fire mode
+{
+ switch (netname)
+ {
+ case "arc": return cvar("g_balance_arc_beam_ammo");
+ case "devastator": return cvar("g_balance_devastator_ammo");
+ case "machinegun": return cvar("g_balance_machinegun_sustained_ammo");
+ case "minelayer": return cvar("g_balance_minelayer_ammo");
+ case "seeker": return cvar("g_balance_seeker_tag_ammo");
+ default: return cvar(strcat("g_balance_", netname, "_primary_ammo"));
+ }
+}
+#endif
+
#ifdef CSQC
int GetAmmoTypeFromNum(int i)
{
string GetAmmoName(int ammotype);
+#ifdef SVQC
+int GetAmmoConsumptionPrimary(string netname);
+#endif
+
#ifdef CSQC
int GetAmmoTypeFromNum(int i);
int GetAmmoStat(int ammotype);
{
int ammo = 0;
if (this.count > 0)
- {
- switch (wpn.netname)
- {
- case "arc": ammo = cvar("g_balance_arc_beam_ammo"); break;
- case "devastator": ammo = cvar("g_balance_devastator_ammo"); break;
- case "machinegun": ammo = cvar("g_balance_machinegun_sustained_ammo"); break;
- case "minelayer": ammo = cvar("g_balance_minelayer_ammo"); break;
- case "seeker": ammo = cvar("g_balance_seeker_tag_ammo"); break;
- default: ammo = cvar(strcat("g_balance_", wpn.netname, "_primary_ammo"));
- }
-
- ammo *= this.count;
- }
+ ammo = this.count * GetAmmoConsumptionPrimary(wpn.netname);
+ // WEAPONTODO: magazines of MG, rifle and OK weapons are unaccounted for
else
{
switch (wpn.ammo_type)