Remove the extra wearables of weapons in TF2_RemoveWeaponSlot.

This commit is contained in:
Ryan Stecker 2014-08-02 19:26:56 -05:00
parent 678e743819
commit 14823723bd

View File

@ -437,6 +437,20 @@ stock TF2_RemoveWeaponSlot(client, slot)
{
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");
if (extraWearable != -1)
{
TF2_RemoveWearable(client, extraWearable);
}
extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearableViewModel");
if (extraWearable != -1)
{
TF2_RemoveWearable(client, extraWearable);
}
}
}