&& probCutCount < 2 + 2 * cutNode)
if (move != excludedMove && pos.legal(move))
{
+ assert(pos.capture_or_promotion(move));
+ assert(depth >= 5);
+
+ captureOrPromotion = true;
probCutCount++;
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)];
-
- assert(depth >= 5);
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck]
+ [captureOrPromotion]
+ [pos.moved_piece(move)]
+ [to_sq(move)];
pos.do_move(move, st);
moves_loop: // When in check, search starts from here
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
- nullptr, (ss-4)->continuationHistory,
- nullptr, (ss-6)->continuationHistory };
+ nullptr , (ss-4)->continuationHistory,
+ nullptr , (ss-6)->continuationHistory };
Move countermove = thisThread->counterMoves[pos.piece_on(prevSq)][prevSq];
countermove,
ss->killers);
- value = bestValue; // Workaround a bogus 'uninitialized' warning under gcc
+ value = bestValue;
moveCountPruning = false;
ttCapture = ttMove && pos.capture_or_promotion(ttMove);
// Update the current move (this must be done after singular extension search)
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][movedPiece][to_sq(move)];
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck]
+ [captureOrPromotion]
+ [movedPiece]
+ [to_sq(move)];
// Step 15. Make the move
pos.do_move(move, st, givesCheck);
Move ttMove, move, bestMove;
Depth ttDepth;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
- bool ttHit, pvHit, inCheck, givesCheck, evasionPrunable, priorCapture;
+ bool ttHit, pvHit, inCheck, givesCheck, captureOrPromotion, evasionPrunable;
int moveCount;
if (PvNode)
(ss+1)->ply = ss->ply + 1;
bestMove = MOVE_NONE;
inCheck = pos.checkers();
- priorCapture = pos.captured_piece();
moveCount = 0;
// Check for an immediate draw or maximum ply reached
}
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
- nullptr, (ss-4)->continuationHistory,
- nullptr, (ss-6)->continuationHistory };
+ nullptr , (ss-4)->continuationHistory,
+ nullptr , (ss-6)->continuationHistory };
// Initialize a MovePicker object for the current position, and prepare
// to search the moves. Because the depth is <= 0 here, only captures,
assert(is_ok(move));
givesCheck = pos.gives_check(move);
+ captureOrPromotion = pos.capture_or_promotion(move);
moveCount++;
}
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)];
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck]
+ [captureOrPromotion]
+ [pos.moved_piece(move)]
+ [to_sq(move)];
// Make and search the move
pos.do_move(move, st, givesCheck);