From f1a52f00feb729d77590fc54c01ec0f799d2938d Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 22 Jan 2011 19:44:36 +0200 Subject: [PATCH] skip non-reloadable weapons, or we access undefined cvars. Also a balance tweak --- balanceXonotic.cfg | 2 +- qcsrc/server/cl_weaponsystem.qc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index e60aa20f1..03712f870 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -243,7 +243,7 @@ set g_balance_laser_secondary_gauntlet 1 set g_balance_laser_secondary_force_zscale 1.25 set g_balance_laser_secondary_force_velocitybias 0 set g_balance_laser_secondary_force_other_scale 0 -set g_balance_laser_reload_ammo 5 +set g_balance_laser_reload_ammo 6 set g_balance_laser_reload_time 2 // }}} // {{{ shotgun diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 5b444e7d1..2c160848d 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -932,6 +932,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) // might still be loaded. The reload code takes care of complaining and forced switching entity e; e = get_weaponinfo(wpn); + if(wpn != WEP_TUBA && wpn != WEP_PORTO && wpn != WEP_HOOK) // skip non-reloadable weapons, or we access undefined cvars if(cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) f = 1; @@ -1058,6 +1059,7 @@ float weapon_prepareattack_checkammo(float secondary) // might still be loaded. The reload code takes care of complaining and forced switching entity e; e = get_weaponinfo(self.weapon); + if(self.weapon != WEP_TUBA && self.weapon != WEP_PORTO && self.weapon != WEP_HOOK) // skip non-reloadable weapons, or we access undefined cvars if(cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) return FALSE; -- 2.39.2