X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=25cbdefd0b10a1b23e9674a35b09776c6bebe98e;hp=cea4efb4bebd1a00deb723e4920d7306db09aa42;hb=1cc44bcaaecf254063138f801271629a81566ee4;hpb=3a4d6e2034a872d9c8550a5024bacb3bd27dcad3 diff --git a/src/movepick.cpp b/src/movepick.cpp index cea4efb4..25cbdefd 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -244,7 +244,7 @@ void MovePicker::score_captures() { for (int i = 0; i < numOfMoves; i++) { m = moves[i].move; - seeValue = pos.see(m); + seeValue = pos.see_sign(m); if (seeValue >= 0) { if (move_is_promotion(m)) @@ -268,20 +268,23 @@ void MovePicker::score_noncaptures() { // First score by history, when no history is available then use // piece/square tables values. This seems to be better then a // random choice when we don't have an history for any move. - Move m; + Piece piece; + Square from, to; int hs; for (int i = 0; i < numOfMoves; i++) { - m = moves[i].move; - hs = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m)); + from = move_from(moves[i].move); + to = move_to(moves[i].move); + piece = pos.piece_on(from); + hs = H.move_ordering_score(piece, to); // Ensure history is always preferred to pst if (hs > 0) hs += 1000; // pst based scoring - moves[i].score = hs + pos.mg_pst_delta(m); + moves[i].score = hs + pos.pst_delta(piece, from, to); } }