]> git.sesse.net Git - ultimatescore/commitdiff
Fix cap handling on equality.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 6 Nov 2017 18:33:44 +0000 (19:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 6 Nov 2017 18:33:44 +0000 (19:33 +0100)
client/mainwindow.cpp

index baf103d988a8e122018bdc6ea08774ff8a6313bb..e92653a9cc4ec8e58dde659a95b01c6d4151b79a 100644 (file)
@@ -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));
 }