X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=6bb5c315554abab89fe17896af79e7427af2e980;hp=582978e69d0c3f1fb2c6535c82d71f564cc85aa7;hb=5bb9da92872f298e6aedb59d728a42dc5719738e;hpb=c7866a4215c31d7d0af8e8550fbf8c13f6ea1d1a diff --git a/src/movepick.cpp b/src/movepick.cpp index 582978e6..6bb5c315 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -213,6 +213,7 @@ void MovePicker::score_noncaptures() { Move m; Piece piece; Square from, to; + int hs; for (MoveStack* cur = moves; cur != lastMove; cur++) { @@ -220,7 +221,14 @@ void MovePicker::score_noncaptures() { from = move_from(m); to = move_to(m); piece = pos.piece_on(from); - cur->score = H.move_ordering_score(piece, to); + hs = H.move_ordering_score(piece, to); + + // Ensure history has always highest priority + if (hs > 0) + hs += 10000; + + // Gain table based scoring + cur->score = hs + 16 * H.gain(piece, to); } }