X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=e28b866e9cb26b2bc26c5bc5460a6e091aa2ef81;hp=e2032638b8650ce112968c4329ea4b08e77ee10e;hb=940c53c366c3993a024efe458fc0fb4fffd3ad70;hpb=e86468cc631ede99530998a6ad269e328f25f808 diff --git a/src/search.cpp b/src/search.cpp index e2032638..e28b866e 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2155,13 +2155,11 @@ namespace { // ok_to_history() returns true if a move m can be stored - // in history. Should be a non capturing move. + // in history. Should be a non capturing move nor a promotion. bool ok_to_history(const Position& pos, Move m) { - return pos.square_is_empty(move_to(m)) - && !move_promotion(m) - && !move_is_ep(m); + return !pos.move_is_capture(m) && !move_promotion(m); } @@ -2174,8 +2172,11 @@ namespace { H.success(pos.piece_on(move_from(m)), m, depth); for (int i = 0; i < moveCount - 1; i++) - if (ok_to_history(pos, movesSearched[i]) && m != movesSearched[i]) + { + assert(m != movesSearched[i]); + if (ok_to_history(pos, movesSearched[i])) H.failure(pos.piece_on(move_from(movesSearched[i])), movesSearched[i]); + } } // fail_high_ply_1() checks if some thread is currently resolving a fail