Square kto = relative_square(us, Side == KING_SIDE ? SQ_G1 : SQ_C1);
Bitboard enemies = pos.pieces(~us);
- assert(!pos.in_check());
+ assert(!pos.checkers());
const int K = Chess960 ? kto > kfrom ? -1 : 1
: Side == KING_SIDE ? -1 : 1;
MoveStack* generate(const Position& pos, MoveStack* mlist) {
assert(Type == CAPTURES || Type == QUIETS || Type == NON_EVASIONS);
- assert(!pos.in_check());
+ assert(!pos.checkers());
Color us = pos.side_to_move();
Bitboard target;
template<>
MoveStack* generate<QUIET_CHECKS>(const Position& pos, MoveStack* mlist) {
- assert(!pos.in_check());
+ assert(!pos.checkers());
Color us = pos.side_to_move();
CheckInfo ci(pos);
template<>
MoveStack* generate<EVASIONS>(const Position& pos, MoveStack* mlist) {
- assert(pos.in_check());
+ assert(pos.checkers());
Square from, checksq;
int checkersCnt = 0;
Bitboard pinned = pos.pinned_pieces();
Square ksq = pos.king_square(pos.side_to_move());
- end = pos.in_check() ? generate<EVASIONS>(pos, mlist)
+ end = pos.checkers() ? generate<EVASIONS>(pos, mlist)
: generate<NON_EVASIONS>(pos, mlist);
while (cur != end)
if ( (pinned || from_sq(cur->move) == ksq || type_of(cur->move) == ENPASSANT)