mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-17 23:56:23 +08:00
Add file distance condition in move_is_legal()
Found another missed control in move_is_legal() thanks to brute force testing. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -714,6 +714,10 @@ bool Position::move_is_legal(const Move m, Bitboard pinned) const {
|
||||
// piece (en passant captures was handled earlier).
|
||||
if (color_of_piece_on(to) != them)
|
||||
return false;
|
||||
|
||||
// From and to files must be one file apart, avoids a7h5
|
||||
if (abs(square_file(from) - square_file(to)) != 1)
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DELTA_N:
|
||||
|
||||
Reference in New Issue
Block a user