X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=59855dba66a56d0ab808f3f75bfce778aca4ee23;hp=c71572e7cf86bead8aa853dd16db512ab329e55d;hb=3e275680d5e9a2b335cddd4bd96bed494987933d;hpb=d087b0a34a6aaa0fc31d2fa256b02861d0351256 diff --git a/src/movepick.cpp b/src/movepick.cpp index c71572e7..59855dba 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -251,21 +251,26 @@ void MovePicker::score_noncaptures() { } } -void MovePicker::score_evasions() { - - for (int i = 0; i < numOfMoves; i++) - { - Move m = moves[i].move; - if (m == ttMove) - moves[i].score = 2*HistoryMax; - else if (!pos.square_is_empty(move_to(m))) - { - int seeScore = pos.see(m); - moves[i].score = (seeScore >= 0)? seeScore + HistoryMax : seeScore; - } else - moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), m); - } - // FIXME try psqt also here +void MovePicker::score_evasions() { + + Move m; + int hs; + + // Use MVV/LVA ordering + for (int i = 0; i < numOfMoves; i++) + { + m = moves[i].move; + + if (m == ttMove) + hs = 2*HistoryMax; + else if (!pos.square_is_empty(move_to(m))) + hs = int(pos.midgame_value_of_piece_on(move_to(m))) + -int(pos.type_of_piece_on(move_from(m))) + HistoryMax; + else + hs = H.move_ordering_score(pos.piece_on(move_from(m)), m); + + moves[i].score = hs; + } } void MovePicker::score_qcaptures() {