Skip to content

Commit 6de225a

Browse files
committed
illegal moves hotfix
bench: 3661572
1 parent 5b903f0 commit 6de225a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src_files/board.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ template<bool prefetch> void Board::move(Move m, TranspositionTable* table) {
490490
if (isCapture(m)) {
491491
// reset fifty move counter if a piece has been captured
492492
newBoardStatus.fiftyMoveCounter = 0;
493-
494-
if (getPieceType(getPiece(sqTo)) == ROOK) {
493+
if (getCapturedPieceType(m) == ROOK) {
495494
if (color == BLACK) {
496495
if (sqTo == A1) {
497496
newBoardStatus.castlingRights &= ~(ONE << (WHITE_QUEENSIDE_CASTLING));
@@ -544,7 +543,6 @@ template<bool prefetch> void Board::move(Move m, TranspositionTable* table) {
544543
this->setPiece(rookTarget, ROOK + 8 * color);
545544
}
546545
}
547-
548546
if constexpr (prefetch)
549547
table->prefetch(getBoardStatus()->zobrist);
550548

0 commit comments

Comments
 (0)