src/chess/pgn.c

changeset 117
ee539a9691f0
parent 107
36dd94278142
child 118
0f2ffbc408ce
--- a/src/chess/pgn.c	Tue Apr 28 12:33:22 2026 +0200
+++ b/src/chess/pgn.c	Wed Apr 29 17:28:03 2026 +0200
@@ -196,7 +196,8 @@
     }
 }
 
-void write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo) {
+void write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo,
+        bool export_comments) {
     // TODO: tag pairs
 
     /* Result */
@@ -250,6 +251,11 @@
         }
         moveblkptr += snpr;
 
+        if (!export_comments) {
+            *(moveblkptr++) = ' ';
+            continue;
+        }
+
         /* add clock times when the game was under time control */
         if (gameinfo->timecontrol) {
             memcpy(moveblkptr, " {[%clk ", 8);

mercurial