Fix move_is_capture() to detect capture promotions

We miss to account as a capture a promotion capture !

Incredible bug in this critical function that is here
since a long time (b50921fd5c of 21/10/2009 !!)

This patch fixes the bug and readds the faster
move_is_capture_or_promotion() that slightly increases
overall speed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-06-22 23:04:57 +01:00
parent 1c42d15340
commit 6a1707889c
3 changed files with 16 additions and 9 deletions

View File

@@ -103,7 +103,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, S
// Skip TT move if is not a capture or a promotion, this avoids
// qsearch tree explosion due to a possible perpetual check or
// similar rare cases when TT table is full.
if (ttm != MOVE_NONE && !pos.move_is_capture(ttm) && !move_is_promotion(ttm))
if (ttm != MOVE_NONE && !pos.move_is_capture_or_promotion(ttm))
ttm = MOVE_NONE;
}
else