diff --git a/src/Replay.hx b/src/Replay.hx index 8f614fd8..381ae315 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 ece62638..2ca93ebb 100644 --- a/src/gui/EndGameGui.hx +++ b/src/gui/EndGameGui.hx @@ -444,13 +444,15 @@ class EndGameGui extends GuiControl { lbPath = 'custom/${mission.id}'; Leaderboards.getScores(lbPath, All, (scores) -> { var hasMyScore = false; + var myTopScoreLB = 0.0; for (score in scores) { if (score.name == Settings.highscoreName) { hasMyScore = true; + myTopScoreLB = score.score; break; } } - if (!hasMyScore) { + if (!hasMyScore || (hasMyScore && myTopScoreLB > timeState.gameplayClock)) { Leaderboards.submitScore(lbPath, timeState.gameplayClock, MarbleGame.instance.world.rewindUsed, (sendReplay, rowId) -> { if (sendReplay && !mission.isClaMission) { Leaderboards.submitReplay(rowId, replayData);