Fix ICS castling rights
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 28 Dec 2011 12:36:23 +0000 (13:36 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Wed, 28 Dec 2011 12:55:54 +0000 (13:55 +0100)
Copying the castling rights together with CopyBoard seems to have
broken handling of ICS rights, where ParseBoard12 prepares a board
in a local variable, an copies it before parsing the rights.

backend.c

index b6a27ab..2925088 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -4473,6 +4473,7 @@ ParseBoard12(string)
             if(board[BOARD_HEIGHT-1][i] == BlackRook) j = i;
         initialRights[4] = boards[moveNum][CASTLING][4] = (castle_bl == 0 && gameInfo.variant != VariantFischeRandom ? NoRights : j);
 
+       boards[moveNum][CASTLING][2] = boards[moveNum][CASTLING][5] = NoRights;
        if(gameInfo.variant == VariantKnightmate) { wKing = WhiteUnicorn; bKing = BlackUnicorn; }
         for(k=BOARD_LEFT; k<BOARD_RGHT; k++)
             if(board[0][k] == wKing) initialRights[2] = boards[moveNum][CASTLING][2] = k;