From ecc7ddb734c9dfb5234689ba21c3f432534e99c4 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 4 Jul 2022 16:24:51 +0200 Subject: [PATCH] Always copy 6 castling rights for incomplete FEN The number of castling rights might not be known at the time the FEN is read, in a setup command. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 0a75b63..b6eea66 100644 --- a/backend.c +++ b/backend.c @@ -15766,7 +15766,7 @@ EditPositionDone (Boolean fakeRights) if(fakeRights) { // [HGM] suppress this if we just pasted a FEN. int r, f; boards[0][EP_STATUS] = EP_NONE; - for(f=0; f<=nrCastlingRights; f++) boards[0][CASTLING][f] = NoRights; + for(f=0; f<=6; f++) boards[0][CASTLING][f] = NoRights; for(r=BOARD_HEIGHT-1; r>=0; r--) for(f=BOARD_RGHT-1; f>=BOARD_LEFT; f--) { // first pass: Kings & e.p. if(rightsBoard[r][f]) { ChessSquare p = boards[0][r][f]; @@ -19029,7 +19029,7 @@ ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) /* set defaults in case FEN is incomplete */ board[EP_STATUS] = EP_UNKNOWN; board[TOUCHED_W] = board[TOUCHED_B] = 0; - for(i=0; i