X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=b57407358cc993113c69e4f35d615e7416accb5e;hb=91e0735ab1cbc57465e0252bc95b90bc2ab13caa;hp=ba7a9afc07921957a6da6fc4d01dd00d7bac8695;hpb=b4785979256d342c544eaca1a6644a70eb96b2e0;p=xboard.git diff --git a/book.c b/book.c index ba7a9af..b574073 100644 --- a/book.c +++ b/book.c @@ -65,8 +65,6 @@ entry_t entry_none = { }; char *promote_pieces=" nbrqac="; -extern char castlingRights[][BOARD_SIZE]; -extern char epStatus[]; uint64 Random64[781] = { U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), @@ -312,16 +310,16 @@ uint64 hash(int moveNr) } // Holdings not implemented yet! - if(castlingRights[moveNr][2] >= 0) { - if(castlingRights[moveNr][0] >= 0) key^=RandomCastle[0]; - if(castlingRights[moveNr][1] >= 0) key^=RandomCastle[1]; + if(boards[moveNr][CASTLING][2] != NoRights) { + if(boards[moveNr][CASTLING][0] != NoRights) key^=RandomCastle[0]; + if(boards[moveNr][CASTLING][1] != NoRights) key^=RandomCastle[1]; } - if(castlingRights[moveNr][5] >= 0) { - if(castlingRights[moveNr][3] >= 0) key^=RandomCastle[2]; - if(castlingRights[moveNr][4] >= 0) key^=RandomCastle[3]; + if(boards[moveNr][CASTLING][5] != NoRights) { + if(boards[moveNr][CASTLING][3] != NoRights) key^=RandomCastle[2]; + if(boards[moveNr][CASTLING][4] != NoRights) key^=RandomCastle[3]; } - f = epStatus[moveNr]; + f = boards[moveNr][EP_STATUS]; if(f >= 0 && f < 8){ if(!WhiteOnMove(moveNr)){ // the test for neighboring Pawns might not be needed,