Merge pull request #121 from VoiDeD/bug-6206

Remove the extra wearables of weapons in TF2_RemoveWeaponSlot (r=psychonic).
This commit is contained in:
Nicholas Hastings 2014-08-02 22:02:14 -04:00
commit 836cde4e21

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