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:
parent
ff9e49bac9
commit
21fc66c246
1 changed files with 16 additions and 12 deletions
|
@ -714,6 +714,10 @@ bool Position::move_is_legal(const Move m, Bitboard pinned) const {
|
||||||
// piece (en passant captures was handled earlier).
|
// piece (en passant captures was handled earlier).
|
||||||
if (color_of_piece_on(to) != them)
|
if (color_of_piece_on(to) != them)
|
||||||
return false;
|
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;
|
break;
|
||||||
|
|
||||||
case DELTA_N:
|
case DELTA_N:
|
||||||
|
|
Loading…
Add table
Reference in a new issue