.float invincible_finished; // ditto
#define spawnfunc_body(item) \
- if (!Item_IsDefinitionAllowed(item)) \
+ if (!(item) || !Item_IsDefinitionAllowed(item)) \
{ \
startitem_failed = true; \
delete(this); \
#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 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");
+ 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"));
}
}
// BFG -> Crylink || Fireball
SPAWNFUNC_Q3_COND(weapon_bfg, ammo_bfg, cvar_string("g_mod_balance") == "XDF", WEP_CRYLINK, WEP_FIREBALL)
+ // FIXME: WEP_FIREBALL has no ammo_type field so ammo_bfg is deleted by spawnfunc_body
// grappling hook -> hook
SPAWNFUNC_WEAPON(weapon_grapplinghook, WEP_HOOK)