0+1 variant games are unrated - closes #8441

pull/8446/head
Thibault Duplessis 2021-03-21 15:07:44 +01:00
parent 1657c7f33f
commit 19063d7062
2 changed files with 5 additions and 3 deletions

View File

@ -681,7 +681,10 @@ object Game {
def allowRated(variant: Variant, clock: Option[Clock.Config]) =
variant.standard || {
clock ?? { _.estimateTotalTime >= Centis(3000) }
clock ?? { c =>
c.estimateTotalTime >= Centis(3000) &&
c.limitSeconds > 0 || c.incrementSeconds > 1
}
}
val gameIdSize = 8

View File

@ -152,8 +152,7 @@ export default class Setup {
limit = parseFloat($timeInput.val() as string),
inc = parseFloat($incrementInput.val() as string),
// no rated variants with less than 30s on the clock
cantBeRated =
(timeMode == '1' && variantId != '1' && limit < 0.5 && inc == 0) || (variantId != '1' && timeMode != '1');
cantBeRated = variantId != '1' && (timeMode != '1' || (limit < 0.5 && inc == 0) || (limit == 0 && inc < 2));
if (cantBeRated && rated) {
$casual.trigger('click');
return toggleButtons();