Actually remove extra wearables.

Old logic was to try to get extra wearables on a non-existent entity.
This commit is contained in:
WildCard65 2014-08-05 09:14:02 -04:00
parent 000cb2b4dd
commit 15304a0059

View File

@ -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");
}
}