From a7fed023fa3a550d6f1ba93d388783b0625f7d4e Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 16 Dec 2019 13:20:15 +1000 Subject: [PATCH] Fix infinite reload spam in dual wielding mode when the secondary weapon runs out of ammo while the primary can still fire --- qcsrc/server/weapons/weaponsystem.qc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 6e74738c7..3191a7636 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -783,6 +783,8 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen { if (!(actor.items & IT_UNLIMITED_AMMO)) { + if (autocvar_g_weaponswitch_debug == 2 && weaponslot(weaponentity) > 0) + return; // in this case the primary weapon will do the switching when it runs out of ammo (TODO: do this same check but for other slots) if (IS_REAL_CLIENT(actor) && actor.reload_complain < time) { play2(actor, SND(UNAVAILABLE)); -- 2.39.2