From: Fabian Fichter Date: Mon, 25 Jan 2021 18:55:02 +0000 (+0100) Subject: Minor cleanup X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2350843436053d79f040a9117ee9e4967242f9c8;p=fairystockfish.git Minor cleanup No functional change. --- diff --git a/src/position.cpp b/src/position.cpp index 72df161..43a9f71 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -783,13 +783,13 @@ Bitboard Position::attackers_to(Square s, Bitboard occupied, Color c, Bitboard j if (board_bb(c, pt) & s) { PieceType move_pt = pt == KING ? king_type() : pt; - // Consider asymmetrical move of horse + // Consider asymmetrical moves (e.g., horse) if (AttackRiderTypes[move_pt] & ASYMMETRICAL_RIDERS) { - Bitboard horses = PseudoAttacks[~c][move_pt][s] & pieces(c, pt); - while (horses) + Bitboard asymmetricals = PseudoAttacks[~c][move_pt][s] & pieces(c, pt); + while (asymmetricals) { - Square s2 = pop_lsb(&horses); + Square s2 = pop_lsb(&asymmetricals); if (attacks_bb(c, move_pt, s2, occupied) & s) b |= s2; } @@ -1146,8 +1146,7 @@ bool Position::gives_check(Move m) const { janggiCannons ^= to; // Is there a discovered check? - if ( ((type_of(m) != DROP && (blockers_for_king(~sideToMove) & from)) || pieces(sideToMove, CANNON, BANNER) - || pieces(HORSE, ELEPHANT) || pieces(JANGGI_CANNON, JANGGI_ELEPHANT)) + if ( ((type_of(m) != DROP && (blockers_for_king(~sideToMove) & from)) || (non_sliding_riders() & pieces(sideToMove))) && attackers_to(square(~sideToMove), (type_of(m) == DROP ? pieces() : pieces() ^ from) | to, sideToMove, janggiCannons)) return true;