1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Make priorCapture a bool

It is always used as a bool, so let's make it a bool straight away.
We can always redefine it as a Piece in a later patch if we want
to use the piece type or the piece color.

No functional change.
This commit is contained in:
Ondrej Mosnacek 2019-10-06 09:57:20 +02:00 committed by Stéphane Nicolet
parent 2e96c513ad
commit c78f8ddd86

View file

@ -594,9 +594,9 @@ namespace {
Move ttMove, move, excludedMove, bestMove; Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth; Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue; Value bestValue, value, ttValue, eval, maxValue;
bool ttHit, ttPv, inCheck, givesCheck, improving, doLMR; bool ttHit, ttPv, inCheck, givesCheck, improving, doLMR, priorCapture;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture; bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece, priorCapture; Piece movedPiece;
int moveCount, captureCount, quietCount, singularLMR; int moveCount, captureCount, quietCount, singularLMR;
// Step 1. Initialize node // Step 1. Initialize node
@ -867,7 +867,7 @@ namespace {
probCutCount++; probCutCount++;
ss->currentMove = move; ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[!!priorCapture][pos.moved_piece(move)][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[priorCapture][pos.moved_piece(move)][to_sq(move)];
assert(depth >= 5); assert(depth >= 5);
@ -1068,7 +1068,7 @@ moves_loop: // When in check, search starts from here
// Update the current move (this must be done after singular extension search) // Update the current move (this must be done after singular extension search)
ss->currentMove = move; ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[!!priorCapture][movedPiece][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[priorCapture][movedPiece][to_sq(move)];
// Step 15. Make the move // Step 15. Make the move
pos.do_move(move, st, givesCheck); pos.do_move(move, st, givesCheck);
@ -1323,8 +1323,7 @@ moves_loop: // When in check, search starts from here
Move ttMove, move, bestMove; Move ttMove, move, bestMove;
Depth ttDepth; Depth ttDepth;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha; Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
Piece priorCapture; bool ttHit, pvHit, inCheck, givesCheck, evasionPrunable, priorCapture;
bool ttHit, pvHit, inCheck, givesCheck, evasionPrunable;
int moveCount; int moveCount;
if (PvNode) if (PvNode)
@ -1476,7 +1475,7 @@ moves_loop: // When in check, search starts from here
} }
ss->currentMove = move; ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[!!priorCapture][pos.moved_piece(move)][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[priorCapture][pos.moved_piece(move)][to_sq(move)];
// Make and search the move // Make and search the move
pos.do_move(move, st, givesCheck); pos.do_move(move, st, givesCheck);