Conversation
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.
Summary
Fixes the Demoman eye glow in the HUD player model not updating with the decapitation count and remaining visible after respawn.
Previously, the effect was refreshed indirectly when touching a resupply cabinet because resupply rebuilt the HUD player model. Respawning reset the server-side decapitation count to
0, but did not trigger the same HUD refresh.The HUD now checks the decapitation count in
CTFHudPlayerClass::OnThink()and setsbForceEyeUpdatewhenever the value changes. For this check, a new value stores the previously observed number of decapitations.The previous decapitation count value is initialized to 0 because the player starts with no heads. If the HUD also needs to force refresh when the current value is initially 0, the previous count can be initialized to -1 instead . On respawn, the count changes from the number of collected heads back to 0, forcing the HUD to remove the green eye effect without requiring resupply.
Demo