[TF2] Fix HUD player model not immediately reflecting loadout changes - #1995
Open
Tkain wants to merge 1 commit into
Open
[TF2] Fix HUD player model not immediately reflecting loadout changes#1995Tkain wants to merge 1 commit into
Tkain wants to merge 1 commit into
Conversation
Right now, when the HUD's player model receives a post_inventory_application game event, it refreshes immediately in order to reflect the player's updated loadout. When this refresh is done, however, it doesn't see the player's updated loadout because it hasn't been reconciled by prediction yet. By deferring the model's refresh to our next think cycle, we ensure that this refresh only occurs after the player's loadout changes are known.
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.
Description
TF2 currently has a bug where the player model in the HUD may not update in response to loadout changes. Observe the model on the lower left below:
Current behavior
Recording.2026-08-11.232252_compressed.mp4
This occurs because the HUD player model refreshes its appearance as soon as it receives notice of a loadout change by receiving the
post_inventory_applicationgame event. At this point in time, the model's code can't observe the player's updated loadout because it hasn't been reconciled by prediction yet.This PR fixes this issue by deferring HUD model refreshes caused by loadout changes to the model's next think cycle, which will only occur after prediction finishes reconciling the player's loadout changes. This ensures that the model is only refreshed when it can access the player's latest loadout data, keeping the model's appearance up to date. See below:
With this PR
Recording.2026-08-11.230855_compressed.mp4