if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
{
+ // don't switch away from reloadable weapons, even if we're out of ammo, since the
+ // weapon itself might still be loaded. The reload code takes care of the switching
+ entity e;
+ e = get_weaponinfo(self.weapon);
+ if(cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+ return FALSE;
+
// always keep the Mine Layer if we placed mines, so that we can detonate them
local entity mine;
if(self.weapon == WEP_MINE_LAYER)
W_Shotgun_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
- return self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
+ {
+ if(autocvar_g_balance_shotgun_reload_ammo)
+ return self.shotgun_load;
+ else
+ return self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
+ }
else if (req == WR_CHECKAMMO2)
{
return TRUE;
self.ammo_counter = -1;
}
else if (req == WR_CHECKAMMO1)
- return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
+ {
+ if(autocvar_g_balance_sniperrifle_reload_ammo)
+ return self.sniperrifle_load;
+ else
+ return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
+ }
else if (req == WR_CHECKAMMO2)
- return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
+ {
+ if(autocvar_g_balance_sniperrifle_reload_ammo)
+ return self.sniperrifle_load;
+ else
+ return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
+ }
else if (req == WR_RELOAD)
{
W_SniperRifle_Reload();