From 5f58db8c9971d8709093ca3c97cecdc99c61303e Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 3 Feb 2013 09:01:55 +0100 Subject: [PATCH] Correctly score enpassant captures Surprisingly this rare case was not considered when scoring a capture. Also take in account that in the promotion case we gain a new piece (typically a queen) but we lose the promoting pawn. These small issues were present since Glaurung times! Found while browsing DiscoCheck sources bench: 5400063 --- src/movepick.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index e6b16cc4..4cf45ad3 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -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]; } } -- 2.39.2