mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix score submission and replay record oob bug
This commit is contained in:
parent
4cdff9d680
commit
53f909e654
2 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue