]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Correctly score enpassant captures
[stockfish] / src / movepick.cpp
index e6b16cc495d238ff078324bf9057e85ca09aa6df..4cf45ad36202b715bd8c8e9efcdef4353256c186 100644 (file)
@@ -168,7 +168,10 @@ void MovePicker::score_captures() {
                  - type_of(pos.piece_moved(m));
 
       if (type_of(m) == PROMOTION)
-          it->score += PieceValue[MG][promotion_type(m)];
+          it->score += PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN];
+
+      else if (type_of(m) == ENPASSANT)
+          it->score += PieceValue[MG][PAWN];
   }
 }