Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix taiko beatmap scroll speed increasing after every save in editor #15522

Merged
merged 2 commits into from
Nov 8, 2021

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Nov 8, 2021

Closes #15435.

There were two root causes for this error:

  • The logic in BeatmapManager.Save() is tricky. Directionality of Copy{From,To} matters there, because the post-conversion editor beatmap is aware of the taiko adjustment, but the database model - a plain BeatmapDifficulty - is not. Using the wrong direction of BeatmapDifficulty.CopyFrom() rather than TaikoMultiplierAppliedDifficulty.CopyTo() caused the post-multiplied value to be stored to DB, which was then multiplied again on next conversion, causing the stacking effect.
  • Secondly, there was a basic logic error in the 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.

Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. Makes sense and is also painful to look at the solution.

@peppy peppy merged commit 2b51803 into ppy:master Nov 8, 2021
@bdach bdach deleted the taiko-slider-multiplier-saving branch November 8, 2021 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Taiko scroll speed increases after saving the beatmap in editor without any changes made
2 participants