From 14fbb3eada4048ab76b1181cb460a0e9b26285a3 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 28 Feb 2017 00:06:02 +1000 Subject: [PATCH] Don't force the switching if the weapon is the same in GiveItems (fixes lastwep bind if player's best weapon is the one they're holding) --- qcsrc/common/t_items.qc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 00b0dcf12..c8e08bbcc 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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); + } } } -- 2.39.2