]> git.sesse.net Git - stockfish/commitdiff
Be sure negative see evasions are at the bottom
authorMarco Costalba <mcostalba@gmail.com>
Fri, 5 Feb 2010 07:19:39 +0000 (08:19 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 5 Feb 2010 07:19:39 +0000 (08:19 +0100)
Because H.move_ordering_score() can return negative values
some negative see moves could be searched before non-negative
see moves with negative history.

This patch restores proper ordering.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movepick.cpp

index 901aa60e5625c766b797fd88d4dec2888b24ac69..650218f48f468f4d36bbae33a6167c219c890d70 100644 (file)
@@ -240,7 +240,7 @@ void MovePicker::score_evasions_or_checks() {
   {
       m = cur->move;
       if ((seeScore = pos.see_sign(m)) < 0)
-          cur->score = seeScore;
+          cur->score = seeScore - HistoryMax; // Be sure are at the bottom
       else if (pos.move_is_capture(m))
           cur->score =  pos.midgame_value_of_piece_on(move_to(m))
                       - pos.type_of_piece_on(move_from(m)) + HistoryMax;