|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
{
Value rBeta = bestValue - 2 * PawnValueMg;
- (ss+1)->excludedMove = RootMoves[0].pv[0];
- (ss+1)->skipNullMove = true;
- Value v = search<NonPV>(pos, ss+1, rBeta - 1, rBeta, (depth - 3) * ONE_PLY);
- (ss+1)->skipNullMove = false;
- (ss+1)->excludedMove = MOVE_NONE;
+ ss->excludedMove = RootMoves[0].pv[0];
+ ss->skipNullMove = true;
+ Value v = search<NonPV>(pos, ss, rBeta - 1, rBeta, (depth - 3) * ONE_PLY);
+ ss->skipNullMove = false;
+ ss->excludedMove = MOVE_NONE;
if (v < rBeta)
stop = true;
&& (ss-1)->reduction
&& threatMove != MOVE_NONE
&& allows(pos, (ss-1)->currentMove, threatMove))
- return beta - 1;
+ return alpha;
}
}
{
// Update occupancy as if the piece and the threat are moving
Bitboard occ = pos.pieces() ^ m1from ^ m1to ^ m2from;
- Piece piece = pos.piece_on(m1from);
+ Piece pc = pos.piece_on(m1from);
// The moved piece attacks the square 'tto' ?
- if (pos.attacks_from(piece, m1to, occ) & m2to)
+ if (pos.attacks_from(pc, m1to, occ) & m2to)
return true;
// Scan for possible X-ray attackers behind the moved piece
- Bitboard xray = (attacks_bb< ROOK>(m2to, occ) & pos.pieces(color_of(piece), QUEEN, ROOK))
- | (attacks_bb<BISHOP>(m2to, occ) & pos.pieces(color_of(piece), QUEEN, BISHOP));
+ Bitboard xray = (attacks_bb< ROOK>(m2to, occ) & pos.pieces(color_of(pc), QUEEN, ROOK))
+ | (attacks_bb<BISHOP>(m2to, occ) & pos.pieces(color_of(pc), QUEEN, BISHOP));
// Verify attackers are triggered by our move and not already existing
if (xray && (xray ^ (xray & pos.attacks_from<QUEEN>(m2to))))