From b2c2eff985a98a2a3979881cdc92e7a0286c2e6b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 6 Nov 2017 19:33:44 +0100 Subject: [PATCH] Fix cap handling on equality. --- client/mainwindow.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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)); } -- 2.39.5