mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
score send criteria change and fix replay record oob bug
This commit is contained in:
parent
ad0e867b48
commit
06d0c6d98e
2 changed files with 6 additions and 2 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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -444,13 +444,15 @@ class EndGameGui extends GuiControl {
|
||||||
lbPath = 'custom/${mission.id}';
|
lbPath = 'custom/${mission.id}';
|
||||||
Leaderboards.getScores(lbPath, All, (scores) -> {
|
Leaderboards.getScores(lbPath, All, (scores) -> {
|
||||||
var hasMyScore = false;
|
var hasMyScore = false;
|
||||||
|
var myTopScoreLB = 0.0;
|
||||||
for (score in scores) {
|
for (score in scores) {
|
||||||
if (score.name == Settings.highscoreName) {
|
if (score.name == Settings.highscoreName) {
|
||||||
hasMyScore = true;
|
hasMyScore = true;
|
||||||
|
myTopScoreLB = score.score;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!hasMyScore) {
|
if (!hasMyScore || (hasMyScore && myTopScoreLB > timeState.gameplayClock)) {
|
||||||
Leaderboards.submitScore(lbPath, timeState.gameplayClock, MarbleGame.instance.world.rewindUsed, (sendReplay, rowId) -> {
|
Leaderboards.submitScore(lbPath, timeState.gameplayClock, MarbleGame.instance.world.rewindUsed, (sendReplay, rowId) -> {
|
||||||
if (sendReplay && !mission.isClaMission) {
|
if (sendReplay && !mission.isClaMission) {
|
||||||
Leaderboards.submitReplay(rowId, replayData);
|
Leaderboards.submitReplay(rowId, replayData);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue