mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
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
This commit is contained in:
@@ -168,7 +168,10 @@ void MovePicker::score_captures() {
|
|||||||
- type_of(pos.piece_moved(m));
|
- type_of(pos.piece_moved(m));
|
||||||
|
|
||||||
if (type_of(m) == PROMOTION)
|
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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user