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 00b0dcf..c8e08bb 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);
+                       }
                }
        }