bool tsumeMode;
bool chess960;
int pieceCountInHand[COLOR_NB][PIECE_TYPE_NB];
+ int virtualPieces;
Bitboard promotedPieces;
void add_to_hand(Piece pc);
void remove_from_hand(Piece pc);
inline bool Position::nnue_applicable() const {
// Do not use NNUE during setup phases (placement, sittuyin)
- return !count_in_hand(ALL_PIECES) || nnue_use_pockets();
+ return (!count_in_hand(ALL_PIECES) || nnue_use_pockets()) && !virtualPieces;
}
inline bool Position::checking_permitted() const {
assert(pieceCountInHand[color_of(pc_hand)][type_of(pc_hand)] > 0 || var->twoBoards);
put_piece(pc_drop, s, pc_drop != pc_hand, pc_drop != pc_hand ? pc_hand : NO_PIECE);
remove_from_hand(pc_hand);
+ virtualPieces += (pieceCountInHand[color_of(pc_hand)][type_of(pc_hand)] < 0);
}
inline void Position::undrop_piece(Piece pc_hand, Square s) {
+ virtualPieces -= (pieceCountInHand[color_of(pc_hand)][type_of(pc_hand)] < 0);
remove_piece(s);
board[s] = NO_PIECE;
add_to_hand(pc_hand);