Fix taiko beatmap scroll speed increasing after every save in editor #15522
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 #15435.
There were two root causes for this error:
BeatmapManager.Save()
is tricky. Directionality ofCopy{From,To}
matters there, because the post-conversion editor beatmap is aware of the taiko adjustment, but the database model - a plainBeatmapDifficulty
- is not. Using the wrong direction ofBeatmapDifficulty.CopyFrom()
rather thanTaikoMultiplierAppliedDifficulty.CopyTo()
caused the post-multiplied value to be stored to DB, which was then multiplied again on next conversion, causing the stacking effect.CopyTo()
implementation - the incorrect object was receiving the de-application of the taiko multiplier.I'm well aware the fix is kinda shoddy, but let's be honest, so is the entire conversion process as we have it what with the haphazard cloning. The least good that can come of this is a temporary fix and added test coverage, which feels like a good-enough thing for now until that's addressed properly.
I also had to expose
TaikoMultiplierAppliedDifficulty
as internal for the test. Hopefully that's okay.