Fix allowed mods being copied into required mods

This commit is contained in:
smoogipoo 2021-02-01 15:06:50 +09:00
parent 426569c2a9
commit b43e529964

View File

@ -1,7 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -33,6 +35,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
AddInternal(loadingLayer = new LoadingLayer(true));
}
protected override void LoadComplete()
{
base.LoadComplete();
Mods.Value = Playlist.FirstOrDefault()?.RequiredMods.Select(m => m.CreateCopy()).ToArray() ?? Array.Empty<Mod>();
}
protected override void OnSetItem(PlaylistItem item)
{
// If the client is already in a room, update via the client.