1
0
Fork 0

score: fix maxScore

master
Mika Dede 2021-09-27 03:46:03 +02:00
parent 2b612de6f6
commit e598c4abf6
No known key found for this signature in database
GPG Key ID: 546586DC38D45BBD
2 changed files with 6 additions and 2 deletions

View File

@ -74,6 +74,10 @@ function showSettingsMenu() {
});
}
function maxScore() {
return Math.max(settings.maxScore, settings.winScore);
}
function setsPerPage() {
return Math.min(settings.setsPerPage, sets());
}
@ -117,7 +121,7 @@ function setWon(set, player) {
let winScoreReached = pScore >= settings.winScore;
let isTwoAhead = !settings.enableTwoAhead || pScore - p2Score >= 2;
let reachedMaxScore = settings.enableMaxScore && pScore >= settings.maxScore;
let reachedMaxScore = settings.enableMaxScore && pScore >= maxScore();
return reachedMaxScore || (winScoreReached && isTwoAhead);
}

View File

@ -72,7 +72,7 @@
};
appMenu['Maximum score'] = {
value: settings.maxScore,
min: settings.winScore,
min: 1,
onchange: m => save('maxScore', m)
};