Promoted pieces were getting the wrong ID letter, of the piece demoted
by 11, rather than 22.
if(PieceToChar(piece) == '+') {
/* [HGM] write promoted pieces as '+<unpromoted>' (Shogi) */
*p++ = '+';
- piece = (ChessSquare)(DEMOTED piece);
+ piece = (ChessSquare)(CHUDEMOTED piece);
}
*p++ = (piece == DarkSquare ? '*' : PieceToChar(piece));
if(p[-1] == '~') {
/* [HGM] flag promoted pieces as '<promoted>~' (Crazyhouse) */
- p[-1] = PieceToChar((ChessSquare)(DEMOTED piece));
+ p[-1] = PieceToChar((ChessSquare)(CHUDEMOTED piece));
*p++ = '~';
}
}
#define DEMOTED (int)WhiteRook - (int)WhiteDragon + (int)
#define SHOGI (int)EmptySquare + (int)
#define CHUPROMOTED ((int)WhitePDragon - (int)WhiteDragon)*(gameInfo.variant == VariantChu) + PROMOTED
+#define CHUDEMOTED ((int)WhiteDragon - (int)WhitePDragon)*(gameInfo.variant == VariantChu) + DEMOTED
#define IS_SHOGI(V) ((V) == VariantShogi || (V) == VariantChu)
#define IS_LION(V) ((V) == WhiteLion || (V) == BlackLion)