From fa597842305d42204d5235203fc6755f255dacf5 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 3 Feb 2025 19:08:26 +0100 Subject: [PATCH] fixed castling rights that were not removed properly --- cpp/src/board.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/board.cpp b/cpp/src/board.cpp index 96a3ddf..df44e61 100644 --- a/cpp/src/board.cpp +++ b/cpp/src/board.cpp @@ -243,9 +243,9 @@ Board Board::make_move(Move move) const { ret.b_castle_rights = NeitherSide; if ((squares[move.source_square] & 0b111) == Rook) { - if (c.x == 0 && (ret.w_castle_rights & QueenSide)) + if (c.x == 0 && (ret.b_castle_rights & QueenSide)) ret.b_castle_rights &= ~(QueenSide); - if (c.x == 7 && (ret.w_castle_rights & KingSide)) + if (c.x == 7 && (ret.b_castle_rights & KingSide)) ret.b_castle_rights &= ~(KingSide); }