Fix SAN of promoted Chu pieces
[xboard.git] / moves.c
diff --git a/moves.c b/moves.c
index 9143842..dbf3924 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -1936,7 +1936,7 @@ CoordsToAlgebraic (Board board, int flags, int rf, int ff, int rt, int ft, int p
        */
         if( c == '~' || c == '+') {
            /* [HGM] print nonexistent piece as its demoted version */
        */
         if( c == '~' || c == '+') {
            /* [HGM] print nonexistent piece as its demoted version */
-           piece = (ChessSquare) (DEMOTED piece);
+           piece = (ChessSquare) (DEMOTED piece - 11*(gameInfo.variant == VariantChu));
         }
         if(c=='+') *outp++ = c;
         *outp++ = ToUpper(PieceToChar(piece));
         }
         if(c=='+') *outp++ = c;
         *outp++ = ToUpper(PieceToChar(piece));