src/chess/rules.c

changeset 218
1e9751f8eb0d
parent 216
d0c3d3016650
--- a/src/chess/rules.c	Thu Sep 03 18:32:47 2026 +0200
+++ b/src/chess/rules.c	Fri Sep 04 13:49:48 2026 +0200
@@ -103,7 +103,9 @@
 }
 
 Color current_color(const GameState *gamestate) {
-    return (gamestate->movecount % 2 == 0) ? WHITE : BLACK;
+    // TODO: better would be an API that returns the correct number
+    unsigned mc = gamestate->movecount + gamestate->move_start;
+    return (mc % 2 == 0) ? WHITE : BLACK;
 }
 
 static void calc_movetime(GameState *gamestate, Move *move) {

mercurial