mirror of
https://github.com/ppy/osu
synced 2025-02-09 14:47:33 +00:00
Improve reliability of mod deserialisation
This commit is contained in:
parent
7084183d6c
commit
a5862ca00d
@ -186,10 +186,7 @@ namespace osu.Game.Scoring
|
|||||||
if (mods != null)
|
if (mods != null)
|
||||||
return mods;
|
return mods;
|
||||||
|
|
||||||
if (apiMods != null)
|
return APIMods.Select(m => m.ToMod(Ruleset.CreateInstance())).ToArray();
|
||||||
return APIMods.Select(m => m.ToMod(Ruleset.CreateInstance())).ToArray();
|
|
||||||
|
|
||||||
return Array.Empty<Mod>();
|
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@ -216,7 +213,7 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
// then check mods set via Mods property.
|
// then check mods set via Mods property.
|
||||||
if (mods != null)
|
if (mods != null)
|
||||||
apiMods = mods.Select(m => new APIMod(m)).ToArray();
|
apiMods ??= mods.Select(m => new APIMod(m)).ToArray();
|
||||||
|
|
||||||
return apiMods ?? Array.Empty<APIMod>();
|
return apiMods ?? Array.Empty<APIMod>();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user