1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00: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:
Marco Costalba 2011-05-22 09:35:34 +01:00
parent ff9e49bac9
commit 21fc66c246

View file

@ -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: