]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix infinite reload spam in dual wielding mode when the secondary weapon runs out...
authorMario <mario.mario@y7mail.com>
Mon, 16 Dec 2019 03:20:15 +0000 (13:20 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 16 Dec 2019 03:20:15 +0000 (13:20 +1000)
qcsrc/server/weapons/weaponsystem.qc

index 6e74738c738eaf5a1bbabcf155bef94c74416ad2..3191a763624cbd0287aa1e988f7a499422f925a6 100644 (file)
@@ -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));