From 53f909e654e802c59de63bb6c8d70b1cc9832344 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Fri, 14 Feb 2025 19:35:15 +0530 Subject: [PATCH] fix score submission and replay record oob bug --- src/Replay.hx | 4 +++- src/gui/EndGameGui.hx | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Replay.hx b/src/Replay.hx index 83fb6179..9e2be374 100644 --- a/src/Replay.hx +++ b/src/Replay.hx @@ -291,7 +291,9 @@ class Replay { public function endFrame() { // Do not record frames beyond par time/5 minutes to limit file size, if we aren't explicitly recording - if (!MarbleGame.instance.toRecord && currentRecordFrame.clockTime > Math.min(300, MarbleGame.instance.world.mission.qualifyTime)) { + if (!MarbleGame.instance.toRecord + && currentRecordFrame != null + && currentRecordFrame.clockTime > Math.min(300, MarbleGame.instance.world.mission.qualifyTime)) { currentRecordFrame = null; return; } diff --git a/src/gui/EndGameGui.hx b/src/gui/EndGameGui.hx index c280aa35..5b39eb65 100644 --- a/src/gui/EndGameGui.hx +++ b/src/gui/EndGameGui.hx @@ -218,14 +218,18 @@ class EndGameGui extends GuiImage { } else { Leaderboards.getScores(mission.path, All, lbscores -> { var foundScore = false; + var foundLBScore:Float = 0; for (lb in lbscores) { if (lb.name == Settings.highscoreName) { foundScore = true; + foundLBScore = lb.score; break; } } if (!foundScore) { submitScore(); + } else if (foundLBScore > score) { + submitScore(); } }); }