]> git.sesse.net Git - stockfish/commitdiff
Change condition to use relative rank
authorhomoSapiensSapiens <reuvenpe2005@gmail.com>
Mon, 9 Sep 2013 19:12:15 +0000 (22:12 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 9 Sep 2013 22:47:31 +0000 (00:47 +0200)
No functional change

src/evaluate.cpp

index 340a342fc62f0148bdcd2b108d309ba8545bbb9c..c7fec9131e11ceeef0b1499c92b2ea1c012c0d83 100644 (file)
@@ -818,7 +818,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
             ebonus -= Value(square_distance(pos.king_square(Us), blockSq) * 2 * rr);
 
             // If blockSq is not the queening square then consider also a second push
-            if (rank_of(blockSq) != (Us == WHITE ? RANK_8 : RANK_1))
+            if (relative_rank(Us, blockSq) != RANK_8)
                 ebonus -= Value(square_distance(pos.king_square(Us), blockSq + pawn_push(Us)) * rr);
 
             // If the pawn is free to advance, increase bonus