mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Fix a subtle bug in Position::move_is_capture()
Currently fails if we test with a move that is not of from the side to move but from the opponent. This is the typical case of the threat from null move search. The result is an erroneus prune of the defending moves, see PruneDefendingMoves in ok_to_prune() Fix the test to work also with threat moves. Bug was always in but was unhidden by a patch of 17/12/2008 "Trigger of PawnEndgameExtension if capture is not a pawn" Until then it was hidden by a tricky check in the prune conditions instead of the natural move_is_capture() Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
30e8f0c9ad
commit
52ed0e9563
1 changed files with 1 additions and 1 deletions
|
@ -665,7 +665,7 @@ bool Position::move_is_capture(Move m) const {
|
|||
assert(m != MOVE_NONE);
|
||||
|
||||
return ( !square_is_empty(move_to(m))
|
||||
&& (color_of_piece_on(move_to(m)) == opposite_color(side_to_move()))
|
||||
&& (color_of_piece_on(move_to(m)) != color_of_piece_on(move_from(m)))
|
||||
)
|
||||
|| move_is_ep(m);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue