Permalink
Browse files

Revert to cheap version but with >= RANK_5

  • Loading branch information...
1 parent 4d34922 commit 603053be6606429cad3ed9e853ff726e5e9e5285 @mcostalba committed Sep 21, 2012
Showing with 6 additions and 8 deletions.
  1. +6 −8 src/evaluate.cpp
View
@@ -597,16 +597,14 @@ Value do_evaluate(const Position& pos, Value& margin) {
&& !(pos.pieces(Them, PAWN) & attack_span_mask(Us, s)))
score += evaluate_outposts<Piece, Us>(pos, ei, s);
- if (Piece == ROOK || Piece == QUEEN)
+ if ( (Piece == ROOK || Piece == QUEEN)
+ && relative_rank(Us, s) >= RANK_5)
{
// Pawns on same rank as rook or queen
- if (relative_rank(Us, s) == RANK_5)
- {
- Bitboard pawns = pos.pieces(Them, PAWN) & RankBB[rank_of(s)];
- if (pawns)
- score += (more_than_one(pawns) ? 3 : 1)
- * (Piece == ROOK ? RookBonusPerPawn : QueenBonusPerPawn);
- }
+ Bitboard pawns = pos.pieces(Them, PAWN) & RankBB[rank_of(s)];
+ if (pawns)
+ score += (more_than_one(pawns) ? 3 : 1)
+ * (Piece == ROOK ? RookBonusPerPawn : QueenBonusPerPawn);
// Queen or rook on 7th rank
if ( relative_rank(Us, s) == RANK_7

0 comments on commit 603053b

Please sign in to comment.