fix score submission and replay record oob bug

This commit is contained in:
RandomityGuy 2025-02-14 19:35:15 +05:30
parent 4cdff9d680
commit 53f909e654
2 changed files with 7 additions and 1 deletions

View file

@ -291,7 +291,9 @@ class Replay {
public function endFrame() { public function endFrame() {
// Do not record frames beyond par time/5 minutes to limit file size, if we aren't explicitly recording // 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; currentRecordFrame = null;
return; return;
} }

View file

@ -218,14 +218,18 @@ class EndGameGui extends GuiImage {
} else { } else {
Leaderboards.getScores(mission.path, All, lbscores -> { Leaderboards.getScores(mission.path, All, lbscores -> {
var foundScore = false; var foundScore = false;
var foundLBScore:Float = 0;
for (lb in lbscores) { for (lb in lbscores) {
if (lb.name == Settings.highscoreName) { if (lb.name == Settings.highscoreName) {
foundScore = true; foundScore = true;
foundLBScore = lb.score;
break; break;
} }
} }
if (!foundScore) { if (!foundScore) {
submitScore(); submitScore();
} else if (foundLBScore > score) {
submitScore();
} }
}); });
} }