From: H.G. Muller Date: Wed, 13 Jan 2010 10:42:52 +0000 (+0100) Subject: Fix omission in castling refactoring for ICS received boards X-Git-Tag: master-20100118~6 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c948f38c96384998f183aab3298f94833e18f26c;p=xboard.git 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. --- 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);