Fix same-name safety firing wrongly

This commit is contained in:
Bartłomiej Dach 2022-01-23 19:54:57 +01:00
parent afc48d86df
commit 47429fb0c6
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ public virtual void Save(BeatmapInfo beatmapInfo, IBeatmap beatmapContent, ISkin
string targetFilename = getFilename(beatmapInfo);
// ensure that two difficulties from the set don't point at the same beatmap file.
if (setInfo.Beatmaps.Any(b => string.Equals(b.Path, targetFilename, StringComparison.OrdinalIgnoreCase)))
if (setInfo.Beatmaps.Any(b => b.ID != beatmapInfo.ID && string.Equals(b.Path, targetFilename, StringComparison.OrdinalIgnoreCase)))
throw new InvalidOperationException($"{setInfo.GetDisplayString()} already has a difficulty with the name of '{beatmapInfo.DifficultyName}'.");
if (existingFileInfo != null)