Skip to content

[TF2] Fix - sync demoman HUD eye glow with decapitation count - #2091

Open
SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:demo-eyeglow-hud-fix
Open

SanyaKor wants to merge 1 commit into
ValveSoftware:masterfrom
SanyaKor:demo-eyeglow-hud-fix

Conversation

@SanyaKor

Copy link
Copy Markdown

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 sets bForceEyeUpdate whenever 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

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