Closed matthewlai closed 9 years ago
In position.cpp, void Position::set(const string& fenStr, bool isChess960, Thread* th):
There is no checking for colour of the rook when finding rsq for castling.
for (rsq = relative_square(c, SQ_A1); type_of(piece_on(rsq)) != ROOK; ++rsq) {}
In some positions, it may pick up an opponent rook: 4k3/pppppppp/8/8/8/8/PPPPPPPP/rR2K3 w Q - 0 1
Bug confirmed. Pull request open:
https://github.com/official-stockfish/Stockfish/pull/357
Thanks for reporting: very old and subtle bug, good catch!
Thanks!
Fix applied.
In position.cpp, void Position::set(const string& fenStr, bool isChess960, Thread* th):
There is no checking for colour of the rook when finding rsq for castling.
for (rsq = relative_square(c, SQ_A1); type_of(piece_on(rsq)) != ROOK; ++rsq) {}
In some positions, it may pick up an opponent rook: 4k3/pppppppp/8/8/8/8/PPPPPPPP/rR2K3 w Q - 0 1