Bitboard occupied, stmAttackers;
balance = PieceValue[MG][piece_on(to)];
- occupied = 0;
if (balance < threshold)
return false;
- if (nextVictim == KING)
- return true;
-
balance -= PieceValue[MG][nextVictim];
- if (balance >= threshold)
+ if (balance >= threshold) // Always true if nextVictim == KING
return true;
bool relativeStm = true; // True if the opponent is to move
- occupied ^= pieces() ^ from ^ to;
+ occupied = pieces() ^ from ^ to;
// Find all attackers to the destination square, with the moving piece removed,
// but possibly an X-ray attacker added behind it.