Print PGN Piece tag listing engine-defined pieces
[xboard.git] / pgntags.c
index 23957f6..2caed09 100644 (file)
--- a/pgntags.c
+++ b/pgntags.c
@@ -1,7 +1,7 @@
 /*
  * pgntags.c -- Functions to manage PGN tags
  *
- * Copyright 1995, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
  *
  * Enhancements Copyright 2005 Alessandro Scotti
  *
@@ -144,6 +144,7 @@ ParsePGNTag (char *tag, GameInfo *gameInfo)
 void
 PrintPGNTags (FILE *fp, GameInfo *gameInfo)
 {
+    char *p;
     fprintf(fp, "[Event \"%s\"]\n", gameInfo->event ? gameInfo->event : "?");
     fprintf(fp, "[Site \"%s\"]\n", gameInfo->site ? gameInfo->site : "?");
     fprintf(fp, "[Date \"%s\"]\n", gameInfo->date ? gameInfo->date : "?");
@@ -159,6 +160,8 @@ PrintPGNTags (FILE *fp, GameInfo *gameInfo)
        fprintf(fp, "[TimeControl \"%s\"]\n", gameInfo->timeControl);
     if (gameInfo->variant != VariantNormal)
         fprintf(fp, "[Variant \"%s\"]\n", VariantName(gameInfo->variant));
+    if (*(p = CollectPieceDescriptors()))
+        fprintf(fp, "[Pieces \"%s\"]\n", p);
     if (gameInfo->extraTags)
        fputs(gameInfo->extraTags, fp);
 }