Conversation
Contributor
|
Is there a reason to remove the commented out DevMsg? |
Author
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 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_iHighestUpgradeLeveland 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%):
The third upgrade gives +300%:
216 + 216 * 3 = 864 HPfor 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