1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 01:29:36 +00:00

Fix bug in useless checks prune

With current code we could raise bestValue above beta,
not what is intended for.

Spotted by Richard Vida.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2012-01-29 22:38:08 +01:00
parent a94fd3bbec
commit df31398bb9

View file

@ -1282,12 +1282,7 @@ split_point_start: // At split points actual search starts from here
&& !pos.is_capture_or_promotion(move) && !pos.is_capture_or_promotion(move)
&& ss->eval + PawnValueMidgame / 4 < beta && ss->eval + PawnValueMidgame / 4 < beta
&& !check_is_dangerous(pos, move, futilityBase, beta, &bestValue)) && !check_is_dangerous(pos, move, futilityBase, beta, &bestValue))
{
if (ss->eval + PawnValueMidgame / 4 > bestValue)
bestValue = ss->eval + PawnValueMidgame / 4;
continue; continue;
}
// Check for legality only before to do the move // Check for legality only before to do the move
if (!pos.pl_move_is_legal(move, ci.pinned)) if (!pos.pl_move_is_legal(move, ci.pinned))