fix missing support for 0+X time control

Fri, 17 Apr 2026 12:24:03 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 17 Apr 2026 12:24:03 +0200
changeset 103
a2a68fd9f6cc
parent 102
463c648e6a9b
child 104
0f69fe56a4cd

fix missing support for 0+X time control

fixes #823

src/chess/rules.c file | annotate | diff | comparison | revisions
--- a/src/chess/rules.c	Fri Apr 17 12:00:18 2026 +0200
+++ b/src/chess/rules.c	Fri Apr 17 12:24:03 2026 +0200
@@ -790,6 +790,11 @@
     unsigned used_time = 0;
     suseconds_t micros = 0;
 
+    /* when this is a 0+X game, the clock starts with the increment */
+    if (gameinfo->time == 0) {
+        total_time += gameinfo->addtime;
+    }
+
     /* go through all already played moves */
     unsigned first_move = move_number % 2;
     unsigned next_move = move_number;

mercurial