Skip to content

Commit

Permalink
Exclude queen from Rook Contact Check computation
Browse files Browse the repository at this point in the history
In ei.attackedBy, Queen does not x-ray through Rook, but the Rook does
X-ray through the Queen.

So most of the rook contact checks supported by queen are, in fact,
Queen Contact Checks and they are already scored separately.

Bench: 7762189

Resolves #338
  • Loading branch information
Rocky640 authored and zamar committed Apr 18, 2015
1 parent 6c040c8 commit 078625e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluate.cpp
Expand Up @@ -438,7 +438,7 @@ namespace {
{
// ...and then remove squares not supported by another enemy piece
b &= ( ei.attackedBy[Them][PAWN] | ei.attackedBy[Them][KNIGHT]
| ei.attackedBy[Them][BISHOP] | ei.attackedBy[Them][QUEEN]);
| ei.attackedBy[Them][BISHOP]);

if (b)
attackUnits += RookContactCheck * popcount<Max15>(b);
Expand Down

1 comment on commit 078625e

@stockfishdeveloper
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for only the occasions in which a rook is attacking a queen? If so, maybe you could try to do the same thing for bishops x-raying the queen. Maybe this would work, because also bishops x-ray the queen.

Please sign in to comment.