]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't force the switching if the weapon is the same in GiveItems (fixes lastwep bind...
authorMario <mario@smbclan.net>
Mon, 27 Feb 2017 14:06:02 +0000 (00:06 +1000)
committerMario <mario@smbclan.net>
Mon, 27 Feb 2017 14:06:02 +0000 (00:06 +1000)
qcsrc/common/t_items.qc

index 00b0dcf12b5d342c46cbf44b09172d74dbd4fda8..c8e08bbcc7306fcf6decdef1f88a7b7dfea4d120 100644 (file)
@@ -1916,7 +1916,11 @@ float GiveItems(entity e, float beginarg, float endarg)
                {
                        .entity weaponentity = weaponentities[slot];
                        if(_switchweapon & BIT(slot))
-                               W_SwitchWeapon_Force(e, w_getbestweapon(e, weaponentity), weaponentity);
+                       {
+                               Weapon wep = w_getbestweapon(e, weaponentity);
+                               if(wep != e.(weaponentity).m_switchweapon)
+                                       W_SwitchWeapon_Force(e, wep, weaponentity);
+                       }
                }
        }