]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Small touches to book.cpp
[stockfish] / src / movepick.cpp
index e9f31456ac110a88833e92e571bbf046e448ed7c..6bfe14571809658b5ace78fa8fce3dc41c18c794 100644 (file)
@@ -252,10 +252,10 @@ void MovePicker::score_captures() {
   {
       m = cur->move;
       cur->score =  piece_value_midgame(pos.piece_on(move_to(m)))
-                  - piece_type(pos.piece_on(move_from(m)));
+                  - type_of(pos.piece_on(move_from(m)));
 
       if (move_is_promotion(m))
-          cur->score += QueenValueMidgame;
+          cur->score += piece_value_midgame(Piece(promotion_piece_type(m)));
   }
 }
 
@@ -291,7 +291,7 @@ void MovePicker::score_evasions() {
           cur->score = seeScore - History::MaxValue; // Be sure we are at the bottom
       else if (pos.move_is_capture(m))
           cur->score =  piece_value_midgame(pos.piece_on(move_to(m)))
-                      - piece_type(pos.piece_on(move_from(m))) + History::MaxValue;
+                      - type_of(pos.piece_on(move_from(m))) + History::MaxValue;
       else
           cur->score = H.value(pos.piece_on(move_from(m)), move_to(m));
   }
@@ -331,8 +331,7 @@ Move MovePicker::get_next_move() {
               if (seeValue >= captureThreshold)
                   return move;
 
-              // Losing capture, move it to the tail of the array, note
-              // that move has now been already checked for pseudo legality.
+              // Losing capture, move it to the tail of the array
               (--badCaptures)->move = move;
               badCaptures->score = seeValue;
           }