Skip to content

[TF2] Fix botkiller related disguise issue#1939

Closed
num-get wants to merge 1 commit into
ValveSoftware:masterfrom
num-get:botkiller_disguise_fix
Closed

[TF2] Fix botkiller related disguise issue#1939
num-get wants to merge 1 commit into
ValveSoftware:masterfrom
num-get:botkiller_disguise_fix

Conversation

@num-get
Copy link
Copy Markdown
Contributor

@num-get num-get commented May 29, 2026

Description

Botkiller disguise has two issues. The spy could clone up to 5 botkiller models when switching to botkiller weapon, and the botkiller model staying after the spy switches to other disguise weapon.
This PR fixes this by looking up items that have item definition "extra_wearable_vm" which is currently exclusively used by botkiller weapons, and then remove the botkiller model.

Before:

ezgif-10a3779788633ade.mp4

After:

ezgif-1b85fc2d15b1b528.mp4

Edit:
Currently this PR will cause edict leak, I will evaluate a better solution later.

@num-get num-get marked this pull request as draft May 29, 2026 10:19
@seanmcgeehan
Copy link
Copy Markdown
Contributor

seanmcgeehan commented May 29, 2026

As discussed this leaks and causes the issue in ValveSoftware/Source-1-Games#8021

I would also be worried that you are also moving these lines to after the drop, which might lead to a leak.

		// Remove botkiller related wearables
		if ( m_hDisguiseWeapon && m_hDisguiseWeapon->GetAttributeContainer()->GetItem()->GetStaticData()->GetExtraWearableViewModel() )
		{
			m_hDisguiseWeapon->RemoveExtraWearables();
		}


The drop happens here.

https://github.com/ValveSoftware/source-sdk-2013/pull/1929/changes#diff-aa946fb2c369973e2c7604d6b538442821f1a81a88f2f9eede45915759ea6118R1137

My suggestion is to leave the cap in place and try to move these lines to right before the drop. That likely fixes the issue. RemovingExtraWearbles entirely in this function will lead to a regression in the battalions backup + quickfix + vaccinator cases, so that cant be done. You have to specifically target botkillers with hard coding.

This is why i went with the cap solution, its ugly, but it prevents the leak and preserves the banner + medigun cases.

In any case you must test battalions backup + quickfix + vaccinator to avoid regression.

@seanmcgeehan
Copy link
Copy Markdown
Contributor

Just reread, and you are actually before the drop but i still think this should go in CTFWeaponBase::Drop before line 1137.

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.

2 participants