Skip to content

Commit

Permalink
Revert to cheap version but with >= RANK_5
Browse files Browse the repository at this point in the history
  • Loading branch information
mcostalba committed Sep 21, 2012
1 parent 4d34922 commit 603053b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/evaluate.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 603053b

Please sign in to comment.