mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Merge pull request #9210 from peppy/fix-tourney-beatmap-change-ooo
Fix tournament displayed beatmap potentially being out of order on quick changes
This commit is contained in:
commit
0d83b0f50a
@ -34,6 +34,7 @@ namespace osu.Game.Tournament.IPC
|
||||
|
||||
private int lastBeatmapId;
|
||||
private ScheduledDelegate scheduled;
|
||||
private GetBeatmapRequest beatmapLookupRequest;
|
||||
|
||||
public Storage Storage { get; private set; }
|
||||
|
||||
@ -77,6 +78,8 @@ namespace osu.Game.Tournament.IPC
|
||||
|
||||
if (lastBeatmapId != beatmapId)
|
||||
{
|
||||
beatmapLookupRequest?.Cancel();
|
||||
|
||||
lastBeatmapId = beatmapId;
|
||||
|
||||
var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null);
|
||||
@ -85,9 +88,9 @@ namespace osu.Game.Tournament.IPC
|
||||
Beatmap.Value = existing.BeatmapInfo;
|
||||
else
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
||||
req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
|
||||
API.Queue(req);
|
||||
beatmapLookupRequest = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
||||
beatmapLookupRequest.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
|
||||
API.Queue(beatmapLookupRequest);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user