From: H.G.Muller Date: Sun, 3 Jan 2016 11:22:25 +0000 (+0100) Subject: Fix FEN castling rank for Knightmate X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=f2bdbde59c9d7595411bac5bc3a247b5336a3534;p=xboard.git Fix FEN castling rank for Knightmate The newly introduced castlingRank array was not correctly set on reading a FEN for Knightmate, because it was looking for Kings rather than Unicorns. --- diff --git a/backend.c b/backend.c index bc9aa62..cfbecf7 100644 --- a/backend.c +++ b/backend.c @@ -18094,7 +18094,7 @@ ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) int i, j, k, w=0, subst=0, shuffle=0, wKingRank = -1, bKingRank = -1; char *p, c; int emptycount, virgin[BOARD_FILES]; - ChessSquare piece; + ChessSquare piece, king = (gameInfo.variant == VariantKnightmate ? WhiteUnicorn : WhiteKing); p = fen; @@ -18163,8 +18163,8 @@ ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) p++; } board[i][(j++)+gameInfo.holdingsWidth] = piece; - if(piece == WhiteKing) wKingRank = i; - if(piece == BlackKing) bKingRank = i; + if(piece == king) wKingRank = i; + if(piece == WHITE_TO_BLACK king) bKingRank = i; } else { return FALSE; }