Skip to content

[TF2] Fix MvM health upgrades for carried buildings - #2087

Open
SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:mvm-carried-building-health-fix
Open

SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:mvm-carried-building-health-fix

Conversation

@SanyaKor

@SanyaKor SanyaKor commented Sep 15, 2026

Copy link
Copy Markdown

Fix MvM health upgrades for carried buildings

Fixes incorrect building health when buying or refunding Building Health while carrying a building.

Issue : Youtube demo

Cause

Carried buildings temporarily reset to Level 1 for the redeployment animation. Their previous level is saved in m_iHighestUpgradeLevel and restored as they rebuild after placement.

However, ApplyHealthUpgrade() calculates health using the temporary Level 1, even when the saved level is 3.

Why 450 HP instead of 648 HP?

A Level 1 building has 150 HP, while Level 3 has 216 HP. With the second Building Health upgrade (+200%):

Incorrect: 150 + 150 * 2 = 450 HP (+200% from Level 1)
Correct:   216 + 216 * 2 = 648 HP (+200% from Level 3)

The third upgrade gives +300%: 216 + 216 * 3 = 864 HP for Level 3.

Change

Health upgrades now account for the building's saved level while it is being carried. A carried Level 3 building therefore receives the correct health for Level 3.

The saved pickup health is also updated when buying or refunding upgrades, so placing the building does not restore its old HP.

This applies to sentries, dispensers, and teleporters. Mini-sentries keep their existing health calculation and also receive the saved-health update.

Related exploit

Also fixes the longstanding exploit where refunding Building Health while carrying any building could preserve its upgraded HP after placement until it was destroyed.

Additionally, it fixes an exploit that allowed teleporters to gain effectively unlimited HP.
Fixes ValveSoftware/Source-1-Games#8188

@JoriKos

JoriKos commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Is there a reason to remove the commented out DevMsg?

@SanyaKor

Copy link
Copy Markdown
Author

Is there a reason to remove the commented out DevMsg?

I used several dev message calls while debugging and removed them afterwards. Since this one was already commented out, I assumed that i could remove it as well to keep the code clean. I can restore it if needed .

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.

[TF2] [MVM] Teleport Health Multiplication Exploit

2 participants