Account for double pawn push in evaluate_unstoppable_pawns()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 22 May 2010 17:38:45 +0000 (18:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 22 May 2010 17:42:00 +0000 (18:42 +0100)
One of the most nitpicking patches I have ever seen.

Of course almost no functional change, but added just
becasue we are very pedantic ;-)

Spotted by Marek Kwiatkowski

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

index 0153fa95a41c613cba09a4ff5521dc834da5227d..4987a53122d153e30ec6e87c727ba38e681a9426 100644 (file)
@@ -914,6 +914,7 @@ namespace {
             Square s = pop_1st_bit(&b);
             Square queeningSquare = relative_square(c, make_square(square_file(s), RANK_8));
             int d =  square_distance(s, queeningSquare)
+                   - (relative_rank(c, s) == RANK_2) // Double pawn push
                    - square_distance(pos.king_square(opposite_color(c)), queeningSquare)
                    + int(c != pos.side_to_move());