Fix taiko swell ending samples playing at results sometimes #32085
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.
Closes #32052.
Sooooo... this is going to be a rant...
To understand why this is going to require a rant, dear reader, please do the following:
Now, why on earth would the TOOLBAR have any bearing on anything?
Well, the chain of failure is something like this:
ScrollingHitObjectContainer
. I'm not precisely sure which property it is that triggers the invalidations, but one clearly does. It may be position or size or whichever.layoutCache
, the nextUpdate()
call is going to recompute lifetimes for ALL hitobject entries.UpdateState()
and plays the sample again despite thesamplePlayed
flag inLegacySwell
, because that flag is ephemeral state that does not survive a hitobject getting resurrected.Now I could just fix this locally to the swell, maybe, by having some time lenience check, but the fact that hitobjects can be resurrected by the toolbar appearing, of all possible causes in the world, feels just completely wrong. So I'm adding a local check in SHOC to not overwrite lifetime ends of judged object entries.
The reason why I'm making that check specific to end time is that I can see valid reasons why you would want to recompute lifetime start even on a judged object (such as playfield geometry changing in a significant way). I can't think of a valid reason to do that to lifetime end.