X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6917a0f753d0c309ab6f7d113b2cab6cb3a9841f;hp=0db8f6c2f9978ebf7935a9d8422f5115f3cfd8c1;hb=8a5a64eac563ff755048d40f6a5046ea4dcf0154;hpb=a87a1005ad63c8076a79ea3b2648f87fea49cfc5 diff --git a/src/search.cpp b/src/search.cpp index 0db8f6c2..6917a0f7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -812,7 +812,7 @@ moves_loop: // When in check search starts from here movedPiece = pos.moved_piece(move); givesCheck = type_of(move) == NORMAL && !pos.discovered_check_candidates() - ? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move) + ? pos.check_squares(type_of(movedPiece)) & to_sq(move) : pos.gives_check(move); moveCountPruning = depth < 16 * ONE_PLY @@ -1196,7 +1196,7 @@ moves_loop: // When in check search starts from here if (bestValue >= beta) { if (!ttHit) - tte->save(pos.key(), value_to_tt(bestValue, ss->ply), BOUND_LOWER, + tte->save(posKey, value_to_tt(bestValue, ss->ply), BOUND_LOWER, DEPTH_NONE, MOVE_NONE, ss->staticEval, TT.generation()); return bestValue; @@ -1220,7 +1220,7 @@ moves_loop: // When in check search starts from here assert(is_ok(move)); givesCheck = type_of(move) == NORMAL && !pos.discovered_check_candidates() - ? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move) + ? pos.check_squares(type_of(pos.moved_piece(move))) & to_sq(move) : pos.gives_check(move); moveCount++; @@ -1375,7 +1375,7 @@ moves_loop: // When in check search starts from here CapturePieceToHistory& captureHistory = pos.this_thread()->captureHistory; Piece moved_piece = pos.moved_piece(move); PieceType captured = type_of(pos.piece_on(to_sq(move))); - captureHistory.update(moved_piece,to_sq(move), captured, bonus); + captureHistory.update(moved_piece, to_sq(move), captured, bonus); // Decrease all the other played capture moves for (int i = 0; i < captureCnt; ++i)