Merge pull request #2438 from peppy/fix-intro-race-condition

Fix intro setting beatmap in background thread causing race conditions
This commit is contained in:
Dan Balasescu 2018-04-23 17:44:03 +09:00 committed by GitHub
commit f0071eab4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,9 +70,8 @@ namespace osu.Game.Screens.Menu
}
}
Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
track = Beatmap.Value.Track;
beatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
track = beatmap.Track;
welcome = audio.Sample.Get(@"welcome");
seeya = audio.Sample.Get(@"seeya");
@ -81,6 +81,8 @@ namespace osu.Game.Screens.Menu
{
base.OnEntering(last);
Game.Beatmap.Value = beatmap;
if (menuVoice)
welcome.Play();