From 4b8a7f2793f0d7dd46d2804cd5f46ccdb080da12 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 11 Jun 2011 22:11:17 +0100 Subject: [PATCH] Fix score_captures() for the case of capture promotions 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 --- src/movepick.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 61e5527f..04fa40d6 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -224,11 +224,11 @@ void MovePicker::score_captures() { 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)) - 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; } } -- 2.39.2