mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Fix check against LegacyID for non-default rulesets
This commit is contained in:
parent
3a5283f96d
commit
a321bcf3af
@ -72,7 +72,7 @@ namespace osu.Game.Rulesets
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
|
||||||
//add any other modes
|
//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)
|
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo == r.RulesetInfo.InstantiationInfo) == null)
|
||||||
context.RulesetInfo.Add(r.RulesetInfo);
|
context.RulesetInfo.Add(r.RulesetInfo);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
private void load(BeatmapManager beatmaps)
|
private void load(BeatmapManager beatmaps)
|
||||||
{
|
{
|
||||||
var sets = beatmaps.GetAllUsableBeatmapSets();
|
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)));
|
allBeatmaps.ForEach(b => beatmapDisplays.Add(new BeatmapDisplay(b)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user