From 15304a00592ec8889ca98aa210bd84e2f3433cf3 Mon Sep 17 00:00:00 2001 From: WildCard65 Date: Tue, 5 Aug 2014 09:14:02 -0400 Subject: [PATCH 1/2] Actually remove extra wearables. Old logic was to try to get extra wearables on a non-existent entity. --- plugins/include/tf2_stocks.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/include/tf2_stocks.inc b/plugins/include/tf2_stocks.inc index 72d3dbca..9af4f9bc 100644 --- a/plugins/include/tf2_stocks.inc +++ b/plugins/include/tf2_stocks.inc @@ -435,9 +435,6 @@ stock TF2_RemoveWeaponSlot(client, slot) new weaponIndex; while ((weaponIndex = GetPlayerWeaponSlot(client, slot)) != -1) { - RemovePlayerItem(client, weaponIndex); - AcceptEntityInput(weaponIndex, "Kill"); - // bug #6206 // papering over a valve bug where a weapon's extra wearables aren't properly removed from the weapon's owner new extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearable"); @@ -451,6 +448,9 @@ stock TF2_RemoveWeaponSlot(client, slot) { TF2_RemoveWearable(client, extraWearable); } + + RemovePlayerItem(client, weaponIndex); + AcceptEntityInput(weaponIndex, "Kill"); } } From dfba8757f7889dc772e66a0bb75a558bfc43bbe7 Mon Sep 17 00:00:00 2001 From: WildCard65 Date: Tue, 5 Aug 2014 09:15:55 -0400 Subject: [PATCH 2/2] Remove un-needed whitespace --- plugins/include/tf2_stocks.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/include/tf2_stocks.inc b/plugins/include/tf2_stocks.inc index 9af4f9bc..e0f250f6 100644 --- a/plugins/include/tf2_stocks.inc +++ b/plugins/include/tf2_stocks.inc @@ -448,7 +448,7 @@ stock TF2_RemoveWeaponSlot(client, slot) { TF2_RemoveWearable(client, extraWearable); } - + RemovePlayerItem(client, weaponIndex); AcceptEntityInput(weaponIndex, "Kill"); }