Add safeties preventing creating multiple difficulties with same name

This commit is contained in:
Bartłomiej Dach
2022-01-23 19:42:07 +01:00
parent 87e2e83288
commit 4f1aac9345
3 changed files with 33 additions and 5 deletions

View File

@ -386,12 +386,20 @@ namespace osu.Game.Screens.Edit
return;
}
try
{
// save the loaded beatmap's data stream.
beatmapManager.Save(editorBeatmap.BeatmapInfo, editorBeatmap.PlayableBeatmap, editorBeatmap.BeatmapSkin);
}
catch (Exception ex)
{
// can fail e.g. due to duplicated difficulty names.
Logger.Error(ex, ex.Message);
return;
}
// no longer new after first user-triggered save.
isNewBeatmap = false;
// save the loaded beatmap's data stream.
beatmapManager.Save(editorBeatmap.BeatmapInfo, editorBeatmap.PlayableBeatmap, editorBeatmap.BeatmapSkin);
updateLastSavedHash();
}