Fix evasion pruning condition
authorJoona Kiiski <joona.kiiski@gmail.com>
Tue, 13 Apr 2010 15:25:50 +0000 (18:25 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 13 Apr 2010 19:28:49 +0000 (20:28 +0100)
Avoid incorrect mate scores in positions like

BK5/1R4b1/2k1Np2/3p3b/2p3pq/p1rB4/n2n1p2/8 w - -

Thanks for Jouni Uski for reporting the problem

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index efdb287fa740a3325c73771f6b43492345b5dd5e..fff523c39e48e538099e3a169c7c9491c59154b5 100644 (file)
@@ -1713,7 +1713,7 @@ namespace {
 
       // Detect blocking evasions that are candidate to be pruned
       evasionPrunable =   isCheck
 
       // Detect blocking evasions that are candidate to be pruned
       evasionPrunable =   isCheck
-                       && bestValue != -VALUE_INFINITE
+                       && bestValue > value_mated_in(PLY_MAX)
                        && !pos.move_is_capture(move)
                        && pos.type_of_piece_on(move_from(move)) != KING
                        && !pos.can_castle(pos.side_to_move());
                        && !pos.move_is_capture(move)
                        && pos.type_of_piece_on(move_from(move)) != KING
                        && !pos.can_castle(pos.side_to_move());