X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.cpp;h=8872e39f3691a8740a8ba1244f8fc3c4664951c5;hb=bb7713c8e92c9373f0294a4317101cccda0e17e5;hp=c6c25d7b42a53eff8daf1e19634367a25d37d310;hpb=5ba85ef441fb12738732824092f74aa49149fcf9;p=stockfish diff --git a/src/movepick.cpp b/src/movepick.cpp index c6c25d7b..8872e39f 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -59,7 +59,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, int searchTT = ttm; ttMoves[0].move = ttm; badCaptureThreshold = 0; - badCaptures = moves + MOVES_MAX; + badCaptures = moves + MAX_MOVES; assert(d > DEPTH_ZERO); @@ -153,7 +153,7 @@ void MovePicker::go_next_phase() { // Bad captures SEE value is already calculated so just pick // them in order to get SEE move ordering. curMove = badCaptures; - lastMove = moves + MOVES_MAX; + lastMove = moves + MAX_MOVES; return; case PH_EVASIONS: @@ -216,18 +216,15 @@ void MovePicker::score_captures() { } void MovePicker::score_noncaptures() { - // Score by history and max gain for the move. + Move m; - Piece piece; - Square from, to; + Square from; for (MoveStack* cur = moves; cur != lastMove; cur++) { m = cur->move; from = move_from(m); - to = move_to(m); - piece = pos.piece_on(from); - cur->score = H.value(piece, to) + H.gain(piece, to); + cur->score = H.value(pos.piece_on(from), move_to(m)); } }