1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Fix intro setting beatmap in background thread causing race conditions

This commit is contained in:
Dean Herbert 2018-04-22 02:42:48 +09:00
parent 295e1c78ee
commit 2c9b2aa0e7

View File

@ -39,6 +39,7 @@ namespace osu.Game.Screens.Menu
private Bindable<bool> menuVoice;
private Bindable<bool> menuMusic;
private Track track;
private WorkingBeatmap beatmap;
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game)
@ -69,8 +70,7 @@ namespace osu.Game.Screens.Menu
}
}
Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
beatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
track = Beatmap.Value.Track;
welcome = audio.Sample.Get(@"welcome");
@ -81,6 +81,8 @@ namespace osu.Game.Screens.Menu
{
base.OnEntering(last);
Game.Beatmap.Value = beatmap;
if (menuVoice)
welcome.Play();