From 4cef74e582ceb34e4a720e38e88195e5979f3bd6 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 26 Mar 2023 08:39:26 +0800 Subject: [PATCH] Should not validate the object in here because status should be valid after re-assign the value in the beatmap processor. --- .../Beatmaps/KaraokeBeatmapProcessor.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapProcessor.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapProcessor.cs index 7e9dc7b40..8c149da21 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapProcessor.cs @@ -36,7 +36,6 @@ private void applyInvalidProperty(IBeatmap beatmap) foreach (var flag in lyric.WorkingPropertyValidator.GetAllInvalidFlags()) { applyInvalidProperty(lyric, flag); - lyric.WorkingPropertyValidator.Validate(flag); } break; @@ -45,7 +44,6 @@ private void applyInvalidProperty(IBeatmap beatmap) foreach (var flag in note.WorkingPropertyValidator.GetAllInvalidFlags()) { applyInvalidProperty(note, flag); - note.WorkingPropertyValidator.Validate(flag); } break; @@ -63,10 +61,7 @@ private void applyInvalidProperty(Lyric lyric, LyricWorkingProperty flag) break; case LyricWorkingProperty.ReferenceLyric: - if (lyric.ReferenceLyric != null || lyric.ReferenceLyricId == null) - return; - - lyric.ReferenceLyric = findLyricById(lyric.ReferenceLyricId.Value); + lyric.ReferenceLyric = findLyricById(lyric.ReferenceLyricId); break; default: @@ -84,10 +79,7 @@ private void applyInvalidProperty(Note note, NoteWorkingProperty flag) break; case NoteWorkingProperty.ReferenceLyric: - if (note.ReferenceLyric != null || note.ReferenceLyricId == null) - return; - - note.ReferenceLyric = findLyricById(note.ReferenceLyricId.Value); + note.ReferenceLyric = findLyricById(note.ReferenceLyricId); break; default: @@ -95,8 +87,8 @@ private void applyInvalidProperty(Note note, NoteWorkingProperty flag) } } - private Lyric findLyricById(int id) => - Beatmap.HitObjects.OfType().Single(x => x.ID == id); + private Lyric? findLyricById(int? id) => + id == null ? null : Beatmap.HitObjects.OfType().Single(x => x.ID == id); public override void PostProcess() {