X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=ca0d8681a1d0515f4fc8c87110ab34124138ecd5;hp=ee747c94525cdee18b9f78ea585abd3854cd23e8;hb=eba8925d810fe9c30db18038830d427c655cdd50;hpb=ee9f650242899373136a76d9549db7f2858c1b06 diff --git a/src/movepick.cpp b/src/movepick.cpp index ee747c94..ca0d8681 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -72,6 +72,7 @@ MovePicker::MovePicker(const Position& p, bool pv, Move ttm, mateKiller = (ss.mateKiller == ttm)? MOVE_NONE : ss.mateKiller; killer1 = ss.killers[0]; killer2 = ss.killers[1]; + threatMove = ss.threatMove; depth = d; movesPicked = 0; numOfMoves = 0; @@ -270,10 +271,16 @@ void MovePicker::score_noncaptures() { else hs = H.move_ordering_score(pos.piece_on(move_from(m)), m); - // Ensure moves in history are always sorted as first + // If the null move was refuted by a capture then give a + // bonus if we move away the captured piece. + if (threatMove != MOVE_NONE && move_from(m) == move_to(threatMove)) + hs *= 3; + + // Ensure history is always preferred to pst if (hs > 0) hs += 1000; + // pst based scoring moves[i].score = hs + pos.mg_pst_delta(m); } }