mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Fix two bugs in ok_to_prune() (2)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+7
-4
@@ -2167,9 +2167,11 @@ namespace {
|
|||||||
|
|
||||||
// Case 3: If the threatened piece has value less than or equal to the
|
// Case 3: If the threatened piece has value less than or equal to the
|
||||||
// value of the threatening piece, don't prune move which defend it.
|
// value of the threatening piece, don't prune move which defend it.
|
||||||
if(!PruneDefendingMoves && threat != MOVE_NONE
|
if ( !PruneDefendingMoves
|
||||||
&& (piece_value_midgame(pos.piece_on(tfrom))
|
&& threat != MOVE_NONE
|
||||||
>= piece_value_midgame(pos.piece_on(tto)))
|
&& pos.type_of_piece_on(tto) != NO_PIECE_TYPE
|
||||||
|
&& ( pos.midgame_value_of_piece_on(tfrom) >= pos.midgame_value_of_piece_on(tto)
|
||||||
|
|| pos.type_of_piece_on(tfrom) == KING)
|
||||||
&& pos.move_attacks_square(m, tto))
|
&& pos.move_attacks_square(m, tto))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -2179,7 +2181,8 @@ namespace {
|
|||||||
|
|
||||||
// Case 5: If the moving piece in the threatened move is a slider, don't
|
// Case 5: If the moving piece in the threatened move is a slider, don't
|
||||||
// prune safe moves which block its ray.
|
// prune safe moves which block its ray.
|
||||||
if(!PruneBlockingMoves && threat != MOVE_NONE
|
if ( !PruneBlockingMoves
|
||||||
|
&& threat != MOVE_NONE
|
||||||
&& piece_is_slider(pos.piece_on(tfrom))
|
&& piece_is_slider(pos.piece_on(tfrom))
|
||||||
&& bit_is_set(squares_between(tfrom, tto), mto) && pos.see(m) >= 0)
|
&& bit_is_set(squares_between(tfrom, tto), mto) && pos.see(m) >= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user