From c948f38c96384998f183aab3298f94833e18f26c Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 13 Jan 2010 11:42:52 +0100 Subject: [PATCH] Fix omission in castling refactoring for ICS received boards A default of -1 was still used, in stead of NoRights, when no Rook was found. In theory this could have had effect in a setup board 0 in FRC, when there were no Rooks on the back rank. --- backend.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend.c b/backend.c index 204cd44..8c76afd 100644 --- a/backend.c +++ b/backend.c @@ -3705,16 +3705,16 @@ ParseBoard12(string) if(moveNum == 0 || gameInfo.variant != VariantFischeRandom) { int i, j; ChessSquare wKing = WhiteKing, bKing = BlackKing; - for(i=BOARD_LEFT, j= -1; i=BOARD_LEFT; i--) + for(i=BOARD_RGHT-1, j=NoRights; i>=BOARD_LEFT; i--) if(board[0][i] == WhiteRook) j = i; initialRights[1] = boards[moveNum][CASTLING][1] = (castle_wl == 0 && gameInfo.variant != VariantFischeRandom ? NoRights : j); - for(i=BOARD_LEFT, j= -1; i=BOARD_LEFT; i--) + for(i=BOARD_RGHT-1, j=NoRights; i>=BOARD_LEFT; i--) if(board[BOARD_HEIGHT-1][i] == BlackRook) j = i; initialRights[4] = boards[moveNum][CASTLING][4] = (castle_bl == 0 && gameInfo.variant != VariantFischeRandom ? NoRights : j); -- 1.7.0.4