1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Fix check against LegacyID for non-default rulesets

This commit is contained in:
HoLLy 2018-03-11 20:19:03 +01:00
parent 3a5283f96d
commit a321bcf3af
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ namespace osu.Game.Rulesets
context.SaveChanges();
//add any other modes
foreach (var r in instances.Where(r => r.LegacyID < 0))
foreach (var r in instances.Where(r => r.LegacyID == null || r.LegacyID < 0))
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo == r.RulesetInfo.InstantiationInfo) == null)
context.RulesetInfo.Add(r.RulesetInfo);

View File

@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual
private void load(BeatmapManager beatmaps)
{
var sets = beatmaps.GetAllUsableBeatmapSets();
var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID);
var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID == null || ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID);
allBeatmaps.ForEach(b => beatmapDisplays.Add(new BeatmapDisplay(b)));
}