Skip to content

fix: Properly Drop disguise botkiller and non-disguise weapons #1945

Open
seanmcgeehan wants to merge 1 commit into
ValveSoftware:masterfrom
seanmcgeehan:botkiller-fix
Open

fix: Properly Drop disguise botkiller and non-disguise weapons #1945
seanmcgeehan wants to merge 1 commit into
ValveSoftware:masterfrom
seanmcgeehan:botkiller-fix

Conversation

@seanmcgeehan
Copy link
Copy Markdown
Contributor

@seanmcgeehan seanmcgeehan commented May 31, 2026

Description

CTFWeaponBase::Drop has leaked extra wearables since 2009 due to a bad ordering of RemoveExtraWearables and Drop. CTFWeaponBase::Drop is currently only used for disguise weapons. This was exposed in #1824 due to DetermineDisguiseWeapon actually processing extra wearables, and capped at 5 in #1929 . This fix builds on the fix for the leak in #1929, by fully cleaning up any extra wearables with view models and adds logic to clean up extra wearables for non disguise weapons incase drop is ever used for those in the future. The view model fix handles a visual edge in disguises for botkillers if the spy chose to set up extra wearables multiple times. The disguise wearable cap is left in place to prevent leaks with extra wearables without view models. This additionally allows for full disguise functionality from #1824. ExtraWearables with view models are the ones that should be cleaned up

A full round of my testing is attached in video form below. My testing does not hit line 1145 (drop for non disguise weapons), which is not exposed in game, but should be there to prevent future leaks.

https://youtu.be/87DMgfGqxpA

This PR is similar to the closed pr #1939 , but does not share the downsides of that PR.

And yes i hand wrote this pr :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant