}
// Extra penalty for a quiet TT move in previous ply when it gets refuted
- if ((ss-1)->moveCount == 1 && !pos.captured_piece_type())
+ if ((ss-1)->moveCount == 1 && !pos.captured_piece())
{
Value penalty = Value(d * d + 4 * d + 1);
Square prevSq = to_sq((ss-1)->currentMove);
continue;
}
}
+ else if ( depth < 3 * ONE_PLY
+ && !inCheck
+ && bestValue > VALUE_MATED_IN_MAX_PLY
+ && !rootNode
+ && ( captureOrPromotion
+ || givesCheck
+ || pos.advanced_pawn_push(move))
+ && pos.see_sign(move) < VALUE_ZERO
+ )
+ continue;
// Speculative prefetch as early as possible
prefetch(TT.first_entry(pos.key_after(move)));
}
// Extra penalty for a quiet TT move in previous ply when it gets refuted
- if ((ss-1)->moveCount == 1 && !pos.captured_piece_type())
+ if ((ss-1)->moveCount == 1 && !pos.captured_piece())
{
Value penalty = Value(d * d + 4 * d + 1);
Square prevSq = to_sq((ss-1)->currentMove);
}
// Bonus for prior countermove that caused the fail low
else if ( depth >= 3 * ONE_PLY
- && !pos.captured_piece_type()
+ && !pos.captured_piece()
&& is_ok((ss-1)->currentMove))
{
int d = depth / ONE_PLY;