]> git.sesse.net Git - stockfish/commitdiff
Use see() instead of see_sign() in previous patch
authorMarco Costalba <mcostalba@gmail.com>
Tue, 3 Jun 2014 10:38:58 +0000 (12:38 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 3 Jun 2014 10:38:58 +0000 (12:38 +0200)
Before it was working by accident in case of
see_sign() and failing with see() due to how
castle moves are coded (king captures the rook).

Better to explicitly filter out castling moves
and use see() without any surprise/trick.

No functional case.

src/search.cpp

index cb502f077109ef58c3500ea2c3cd0bdbd24a66cb..9a6bd86386807019e73d2eaba746fb6e3a0d0b44 100644 (file)
@@ -870,8 +870,9 @@ moves_loop: // When in check and at SpNode search starts from here
 
           // Decrease reduction for moves that escape a capture
           if (   ss->reduction
 
           // Decrease reduction for moves that escape a capture
           if (   ss->reduction
+              && type_of(move) == NORMAL
               && type_of(pos.piece_on(to_sq(move))) != PAWN
               && type_of(pos.piece_on(to_sq(move))) != PAWN
-              && pos.see_sign(make_move(to_sq(move), from_sq(move))) < 0)
+              && pos.see(make_move(to_sq(move), from_sq(move))) < 0)
               ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
 
           Depth d = std::max(newDepth - ss->reduction, ONE_PLY);
               ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
 
           Depth d = std::max(newDepth - ss->reduction, ONE_PLY);