Skip to content

Commit

Permalink
Fix offset adjust control not correctly applying changes after song s…
Browse files Browse the repository at this point in the history
…elect quit

This is an interesting scenario where we arrive at a fresh
`BeatmapOffsetControl` but with a reference score (from the last play).

Our best assumption here is that the beatmap's offset hasn't changed
since the last play, so we want to use it for the `lastPlayBeatmapOffset`.
But due to unfortunate order of execution, `Current.Value` was not yet
initialised.
  • Loading branch information
peppy committed Sep 5, 2024
1 parent cd8c63f commit 6ab71f6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ protected override void LoadComplete()
{
base.LoadComplete();

ReferenceScore.BindValueChanged(scoreChanged, true);

beatmapOffsetSubscription = realm.SubscribeToPropertyChanged(
r => r.Find<BeatmapInfo>(beatmap.Value.BeatmapInfo.ID)?.UserSettings,
settings => settings.Offset,
Expand All @@ -124,6 +122,7 @@ protected override void LoadComplete()
});

Current.BindValueChanged(currentChanged);
ReferenceScore.BindValueChanged(scoreChanged, true);
}

private void currentChanged(ValueChangedEvent<double> offset)
Expand Down

0 comments on commit 6ab71f6

Please sign in to comment.