From f97db08b443486453ef614f851796fc48fed5606 Mon Sep 17 00:00:00 2001 From: Hermanest Date: Wed, 24 Jul 2024 18:45:54 +0300 Subject: [PATCH] Fixed replayer attempting to update energy before the first note event. --- .../Replayer/Emulation/Scoring/ReplayerScoreProcessor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/2_Core/Replayer/Emulation/Scoring/ReplayerScoreProcessor.cs b/Source/2_Core/Replayer/Emulation/Scoring/ReplayerScoreProcessor.cs index 57d87ca0..78bd9575 100644 --- a/Source/2_Core/Replayer/Emulation/Scoring/ReplayerScoreProcessor.cs +++ b/Source/2_Core/Replayer/Emulation/Scoring/ReplayerScoreProcessor.cs @@ -135,7 +135,7 @@ static void ConvertAndAddSliderData(SliderData sliderData, ICollection private static bool _lastCutIsGood; private static float _lastCutBeforeCutRating; private static float _lastCutAfterCutRating; - private static LinkedListNode _lastNoteEvent = null!; + private static LinkedListNode? _lastNoteEvent; private void SimulateNoteWasCut(NoteEvent noteEvent, bool isGoodCut) { if (!SetupEmulator(noteEvent)) return; @@ -326,6 +326,7 @@ private static void GoodCutScoringInitPostfix(GoodCutScoringElement __instance) } private static void NoteWasProcessedPostfix(GameEnergyCounter __instance) { + if (_lastNoteEvent == null) return; var currentTime = _lastNoteEvent.Value.eventTime; var prevTime = _lastNoteEvent.Previous?.Value.eventTime ?? 0; var nextTime = _lastNoteEvent.Next?.Value.eventTime ?? 0;