]> git.sesse.net Git - stockfish/commitdiff
Fix score_captures() for the case of capture promotions
authorMarco Costalba <mcostalba@gmail.com>
Sat, 11 Jun 2011 21:11:17 +0000 (22:11 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 11 Jun 2011 21:12:13 +0000 (22:12 +0100)
In case we have more than one promotion move, prefer
the one that captures the biggest piece.

Almost no functional change, anyhow I don't expect any
ELO change, it is just the correct thing to do.

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

index 61e5527f42c61d638132201f0b2f2efd18bc999a..04fa40d625ba8212a4dceb2ed0278a966a5b7fe5 100644 (file)
@@ -224,11 +224,11 @@ void MovePicker::score_captures() {
   for (MoveStack* cur = moves; cur != lastMove; cur++)
   {
       m = cur->move;
   for (MoveStack* cur = moves; cur != lastMove; cur++)
   {
       m = cur->move;
+      cur->score =  pos.midgame_value_of_piece_on(move_to(m))
+                  - pos.type_of_piece_on(move_from(m));
+
       if (move_is_promotion(m))
       if (move_is_promotion(m))
-          cur->score = QueenValueMidgame;
-      else
-          cur->score =  pos.midgame_value_of_piece_on(move_to(m))
-                      - pos.type_of_piece_on(move_from(m));
+          cur->score += QueenValueMidgame;
   }
 }
 
   }
 }