From: Mario Date: Mon, 16 Dec 2019 03:20:15 +0000 (+1000) Subject: Fix infinite reload spam in dual wielding mode when the secondary weapon runs out... X-Git-Tag: xonotic-v0.8.5~1212 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7fed023fa3a550d6f1ba93d388783b0625f7d4e;p=xonotic%2Fxonotic-data.pk3dir.git Fix infinite reload spam in dual wielding mode when the secondary weapon runs out of ammo while the primary can still fire --- 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));