Skip to content

Commit

Permalink
Less threat in defended squares
Browse files Browse the repository at this point in the history
  • Loading branch information
MJZ1977 committed May 15, 2018
1 parent aacee91 commit 05ef14e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/evaluate.cpp
Expand Up @@ -546,7 +546,7 @@ namespace {
Square s = pop_lsb(&b);
score += ThreatByMinor[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
score += ThreatByRank * (int)relative_rank(Them, s) / (weak & s ? 1 : 2);
}

b = (pos.pieces(Them, QUEEN) | weak) & attackedBy[Us][ROOK];
Expand All @@ -555,7 +555,7 @@ namespace {
Square s = pop_lsb(&b);
score += ThreatByRook[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
score += ThreatByRank * (int)relative_rank(Them, s) / (weak & s ? 1 : 2);
}

b = weak & attackedBy[Us][KING];
Expand Down

0 comments on commit 05ef14e

Please sign in to comment.