From: Steinar H. Gunderson Date: Mon, 6 Nov 2017 18:33:44 +0000 (+0100) Subject: Fix cap handling on equality. X-Git-Url: https://git.sesse.net/?p=ultimatescore;a=commitdiff_plain;h=b2c2eff985a98a2a3979881cdc92e7a0286c2e6b Fix cap handling on equality. --- diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index baf103d..e92653a 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -286,12 +286,17 @@ void MainWindow::autocomment_update() string msg; if (abs(score1 - score2) >= 3) { msg = "Game ends after this point"; - } else if (score1 >= 12 || score2 >= 12) { - msg = "Point cap: First to 13"; } else { - char buf[32]; - snprintf(buf, sizeof(buf), "Pagacap: First to %d", max(score1, score2) + 1); - msg = buf; + int cap = max(score1, score2) + 1; + if (score1 == score2) ++cap; + + if (cap >= 13) { + msg = "Point cap: First to 13"; + } else { + char buf[32]; + snprintf(buf, sizeof(buf), "Pagacap: First to %d", cap); + msg = buf; + } } ui->autocomment_edit->setText(QString::fromStdString(msg)); }