- // Update checkers bitboard: piece must be already moved due to attacks_from()
- st->checkersBB = 0;
-
- if (moveIsCheck)
- {
- if (type_of(m) != NORMAL)
- st->checkersBB = attackers_to(king_square(them)) & pieces(us);
- else
- {
- // Direct checks
- if (ci.checkSq[pt] & to)
- st->checkersBB |= to;
-
- // Discovered checks
- if (unlikely(ci.dcCandidates) && (ci.dcCandidates & from))
- {
- if (pt != ROOK)
- st->checkersBB |= attacks_from<ROOK>(king_square(them)) & pieces(us, QUEEN, ROOK);
-
- if (pt != BISHOP)
- st->checkersBB |= attacks_from<BISHOP>(king_square(them)) & pieces(us, QUEEN, BISHOP);
- }
- }
- }
+ // Calculate checkers bitboard (if move is check)
+ st->checkersBB = moveIsCheck ? attackers_to(king_square(them)) & pieces(us) : 0;