1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Fix playlists comparing mod equality via APIMod

This commit is contained in:
Dan Balasescu 2022-02-24 17:01:43 +09:00
parent 2acaffd5e7
commit 7193bc8554

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Screens;
using osu.Game.Extensions;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets;
using osu.Game.Scoring;
@ -40,8 +39,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
if (ruleset.Value.OnlineID != PlaylistItem.RulesetID)
throw new InvalidOperationException("Current Ruleset does not match PlaylistItem's Ruleset");
var localMods = Mods.Value.Select(m => new APIMod(m)).ToArray();
if (!PlaylistItem.RequiredMods.All(m => localMods.Any(m.Equals)))
var requiredLocalMods = PlaylistItem.RequiredMods.Select(m => m.ToMod(GameplayState.Ruleset));
if (!requiredLocalMods.All(m => Mods.Value.Any(m.Equals)))
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
}