mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix beatmaps not getting the correct ruleset on import.
This commit is contained in:
@ -219,10 +219,9 @@ namespace osu.Game.Database
|
|||||||
beatmap.BeatmapInfo.Metadata = null;
|
beatmap.BeatmapInfo.Metadata = null;
|
||||||
|
|
||||||
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
||||||
|
beatmap.BeatmapInfo.Ruleset = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID);
|
||||||
beatmap.BeatmapInfo.StarDifficulty = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0;
|
beatmap.BeatmapInfo.StarDifficulty = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0;
|
||||||
|
|
||||||
beatmap.BeatmapInfo.Ruleset = null;
|
|
||||||
|
|
||||||
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
||||||
}
|
}
|
||||||
beatmapSet.StoryboardFile = archive.StoryboardFilename;
|
beatmapSet.StoryboardFile = archive.StoryboardFilename;
|
||||||
@ -239,7 +238,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
foreach (var s in beatmapSets)
|
foreach (var s in beatmapSets)
|
||||||
{
|
{
|
||||||
Connection.InsertWithChildren(s, true);
|
Connection.InsertOrReplaceWithChildren(s, true);
|
||||||
BeatmapSetAdded?.Invoke(s);
|
BeatmapSetAdded?.Invoke(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user