X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.cpp;h=b115e8ffb1a9c3b9a6a1c6371ffef62067eea3e3;hb=a56e1c662c3aa04b88744d62790daa10c01cdc78;hp=2867e7664716ba32c6b5b0d90284a4e75f8ede15;hpb=88885399f4a8bdc579c2b75cd892e78821631c63;p=stockfish diff --git a/src/movepick.cpp b/src/movepick.cpp index 2867e766..b115e8ff 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -207,19 +207,23 @@ void MovePicker::score_captures() { // capture, capturing a more valuable (but sufficiently defended) piece // first usually doesn't hurt. The opponent will have to recapture, and // the hanging piece will still be hanging (except in the unusual cases - // where it is possible to recapture with the hanging piece). Exchanging + // where it is possible to recapture with the hanging piece). Exchanging // big pieces before capturing a hanging piece probably helps to reduce // the subtree size. + Move m; + int seeValue; + for (int i = 0; i < numOfMoves; i++) { - int seeValue = pos.see(moves[i].move); + m = moves[i].move; + seeValue = pos.see(m); if (seeValue >= 0) { - if (move_promotion(moves[i].move)) + if (move_promotion(m)) moves[i].score = QueenValueMidgame; else - moves[i].score = int(pos.midgame_value_of_piece_on(move_to(moves[i].move))) - -int(pos.type_of_piece_on(move_from(moves[i].move))); + moves[i].score = int(pos.midgame_value_of_piece_on(move_to(m))) + -int(pos.type_of_piece_on(move_from(m))); } else moves[i].score = seeValue; } @@ -278,7 +282,7 @@ void MovePicker::score_qcaptures() { moves[i].score = QueenValueMidgame; else moves[i].score = int(pos.midgame_value_of_piece_on(move_to(m))) - -int(pos.midgame_value_of_piece_on(move_to(m))) / 64; + -int(pos.type_of_piece_on(move_from(m))); } }