storing castling rights in 8 bits instead of 32

This commit is contained in:
rektdie committed 2024-05-16 01:35:16 +02:00
1 parent d3a26b29df
commit 4c217fa478
4 files changed
+26 -32

No files matched your search

+3 -3
View File
@@ -510,7 +510,7 @@ static void GenKingMoves(Board &board, bool color) {
}
// Checking for king side castle
if (board.castlingRights[color * 2]) {
if (board.castlingRights & (whiteKingRight | blackKingRight)) {
Bitboard mask = color ? 0xe000000000000000 : 0xe0;
if ((board.occupied & mask).PopCount() == 1) {
@@ -518,8 +518,8 @@ static void GenKingMoves(Board &board, bool color) {
}
}
// Checking for quuen side castle
if (board.castlingRights[color * 2 + 1]) {
// Checking for queen side castle
if (board.castlingRights & (whiteQueenRight | blackQueenRight)) {
Bitboard mask = color ? 0xf00000000000000 : 0xf;
if ((board.occupied & mask).PopCount() == 1) {