fix that checkmate notation did not set the check flag in the move

Sat, 18 Jul 2026 15:01:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 18 Jul 2026 15:01:04 +0200
changeset 144
c3ae96ed44d1
parent 143
e9159c70ff9e
child 145
21b76056a178

fix that checkmate notation did not set the check flag in the move

src/chess/rules.c file | annotate | diff | comparison | revisions
--- a/src/chess/rules.c	Mon Jul 13 22:37:40 2026 +0200
+++ b/src/chess/rules.c	Sat Jul 18 15:01:04 2026 +0200
@@ -727,12 +727,9 @@
     }
     
     /* evaluate check/checkmate flags */
-    if (mstr[len-1] == '+') {
+    if (mstr[len-1] == '+' || mstr[len-1] == '#') {
         len--; mstr[len] = '\0';
-        move->check = 1;
-    } else if (mstr[len-1] == '#') {
-        len--; mstr[len] = '\0';
-        /* ignore - validation should set game state */
+        move->check = true;
     }
     
     /* evaluate promotion */

mercurial