1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:03:22 +08:00

Fix realm migration failures with presence of databased EF rulesets that don't exist on disk

This commit is contained in:
Dean Herbert 2022-01-26 17:57:03 +09:00
parent 4a51bab9ac
commit f2d48d088d

View File

@ -28,21 +28,15 @@ namespace osu.Game.Rulesets
public Ruleset CreateInstance()
{
if (!Available)
throw new RulesetLoadException(@"Ruleset not available");
return null;
var type = Type.GetType(InstantiationInfo);
if (type == null)
throw new RulesetLoadException(@"Type lookup failure");
return null;
var ruleset = Activator.CreateInstance(type) as Ruleset;
if (ruleset == null)
throw new RulesetLoadException(@"Instantiation failure");
// overwrite the pre-populated RulesetInfo with a potentially database attached copy.
// ruleset.RulesetInfo = this;
return ruleset;
}