src/chess/pgn.c

changeset 173
e541b6002933
parent 163
2a6d83f4677e
--- a/src/chess/pgn.c	Fri Aug 14 11:35:36 2026 +0200
+++ b/src/chess/pgn.c	Fri Aug 14 13:40:26 2026 +0200
@@ -59,7 +59,7 @@
 }
 
 static const char *pgn_result(GameState *gamestate) {
-    if (gamestate->stalemate || gamestate->remis) {
+    if (is_game_drawn(gamestate)) {
         return "1/2-1/2";
     } else if (gamestate->wresign) {
         return "0-1";
@@ -196,7 +196,8 @@
                 movetext_ends_with_result = true;
                 break;
             } else if (c == '/') {
-                gamestate->remis = !gamestate->stalemate;
+                /* only set remis flag if the game was not drawn otherwise */
+                gamestate->remis = !is_game_drawn(gamestate);
                 movetext_ends_with_result = true;
                 break;
             } else {

mercurial