]> git.sesse.net Git - stockfish/commitdiff
Correctly score capture underpromotions
authorMarco Costalba <mcostalba@gmail.com>
Sat, 17 Sep 2011 15:41:01 +0000 (16:41 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 24 Sep 2011 16:13:14 +0000 (17:13 +0100)
Be sure a queen capture promotion is tried in front of
an underpromotion.

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

index e9f31456ac110a88833e92e571bbf046e448ed7c..c898127f3ecef51dd8b96b2bbf41737ed45082c7 100644 (file)
@@ -255,7 +255,7 @@ void MovePicker::score_captures() {
                   - piece_type(pos.piece_on(move_from(m)));
 
       if (move_is_promotion(m))
-          cur->score += QueenValueMidgame;
+          cur->score += piece_value_midgame(Piece(promotion_piece_type(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;
           }