]> git.sesse.net Git - stockfish/commit
Fix a subtle bug in Position::move_is_capture()
authorMarco Costalba <mcostalba@gmail.com>
Fri, 13 Feb 2009 13:17:39 +0000 (14:17 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 13 Feb 2009 19:56:26 +0000 (20:56 +0100)
commit52ed0e9563845cb86bd43d637e21a3706b993523
tree6795039f4763002a1f33d480f1215f204398777f
parent30e8f0c9ada37eaf6a4730215c3d05a4c301ade8
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>
src/position.cpp