Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/game/shared/tf/tf_weaponbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,23 @@ void CTFWeaponBase::Drop( const Vector &vecVelocity )
// RemoveDisguiseWearables sweeps it up at full disguise removal which prevents the leak.
if ( m_bDisguiseWeapon && m_hExtraWearableViewModel )
{
m_hExtraWearableViewModel->RemoveFrom( GetOwnerEntity() );
m_hExtraWearableViewModel = NULL;
// the existance of a viewmodel implies it should go away on weapon switch
//for disguised spies.
RemoveExtraWearables();
}
#endif

//Drop is currently only used for disguise weapons,
// but if we ever use it for non-disguise weapons
// we need to make sure to remove the extra wearables here
// so they don't get orphaned in the world.
// Disguise weapons are handled via cap in determineDisguiseWearables
if ( !m_bDisguiseWeapon )
{
RemoveExtraWearables();
}


BaseClass::Drop( vecVelocity );

ReapplyProvision();
Expand Down