// GetAmmoPicture GetAmmoName notif_arg_item_wepammo ammo_pickupevalfunc ?
}
-#ifdef SVQC
-int GetAmmoConsumptionPrimary(string netname)
-// Returns ammo consumed per shot by the primary/default fire mode
-// Returns 0 if the netname has no ammo cvar
-{
- switch (netname)
- {
- case "arc": return autocvar_g_balance_arc_beam_ammo;
- case "devastator": return autocvar_g_balance_devastator_ammo;
- case "machinegun": return autocvar_g_balance_machinegun_sustained_ammo;
- case "minelayer": return autocvar_g_balance_minelayer_ammo;
- case "seeker": return autocvar_g_balance_seeker_tag_ammo;
- default: return cvar(strcat("g_balance_", netname, "_primary_ammo"));
- }
-}
-#endif
-
#ifdef CSQC
int GetAmmoTypeFromNum(int i)
{
entity GetAmmoItem(int ammotype);
-#ifdef SVQC
-int GetAmmoConsumptionPrimary(string netname);
-#endif
-
#ifdef CSQC
int GetAmmoTypeFromNum(int i);
int GetAmmoStat(int ammotype);
return false;
}
+
+int GetAmmoConsumptionQ3(string netname)
+// Returns ammo consumed per shot by the primary/default fire mode
+// Returns 0 if the netname has no ammo cvar
+{
+ switch (netname)
+ {
+ case "arc": return autocvar_g_balance_arc_beam_ammo;
+ case "devastator": return autocvar_g_balance_devastator_ammo;
+ case "machinegun": return autocvar_g_balance_machinegun_sustained_ammo;
+ case "minelayer": return autocvar_g_balance_minelayer_ammo;
+ case "seeker": return autocvar_g_balance_seeker_tag_ammo;
+ default: return cvar(strcat("g_balance_", netname, "_primary_ammo"));
+ }
+}
+
#define Q3COMPAT_DEFI BIT(1)
bool DoesQ3ARemoveThisEntity(entity this);
+int GetAmmoConsumptionQ3(string netname);
.int fragsfilter_cnt;
spawnfunc(ammo_classname) \
{ \
if(this.count && xonwep.ammo_type) \
- SetResource(this, xonwep.ammo_type, this.count * GetAmmoConsumptionPrimary(xonwep.netname)); \
+ SetResource(this, xonwep.ammo_type, this.count * GetAmmoConsumptionQ3(xonwep.netname)); \
SPAWNFUNC_BODY(GetAmmoItem(xonwep.ammo_type)) \
}
if ((wpn.ammo_type != RES_NONE) && !GetResource(this, wpn.ammo_type))
{
int ammo = 0;
- if (this.count > 0)
- ammo = this.count * GetAmmoConsumptionPrimary(wpn.netname);
+ if (q3compat && this.count > 0)
+ ammo = this.count * GetAmmoConsumptionQ3(wpn.netname);
// WEAPONTODO: magazines of MG, rifle and OK weapons are unaccounted for
else
{