fix(cosmetics): purge per-ghost caches on despawn [PATCH 1] - #3
Open
nullbrik wants to merge 1 commit into
Open
Conversation
CosmeticApi keys _ghostGloveRigs and _ghostStickRest by the ghost GameObject pointer, but nothing ever cleared them — unlike FingerApi, which already resets its own per-ghost bone cache. IL2CPP recycles pointers after a despawn, so a new ghost could inherit a departed player's glove rig, and both dictionaries grew for the whole session. _ghostStickRest was the worse of the two: it has no null guard on the cached entry, so a stale rest pose made ApplyGhostStickByAnchorMode bail out every frame while ContainsKey kept the capture block from re-running — the new ghost's stick could never return to its stowed position. Purge both dictionaries from the three places RemotePlayerManager already destroys ghosts, and clear them wholesale on scene reset, next to the existing FingerApi.ResetFingerSyncCache call.
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.
CosmeticApi keys _ghostGloveRigs and _ghostStickRest by the ghost GameObject pointer, but nothing ever cleared them — unlike FingerApi, which already resets its own per-ghost bone cache. IL2CPP recycles pointers after a despawn, so a new ghost could inherit a departed player's glove rig, and both dictionaries grew for the whole session.
_ghostStickRest was the worse of the two: it has no null guard on the cached entry, so a stale rest pose made ApplyGhostStickByAnchorMode bail out every frame while ContainsKey kept the capture block from re-running — the new ghost's stick could never return to its stowed position.
Purge both dictionaries from the three places RemotePlayerManager already destroys ghosts, and clear them wholesale on scene reset, next to the existing FingerApi.ResetFingerSyncCache call.