checkSq[BISHOP] = pos.attacks_from<BISHOP>(ksq);
checkSq[ROOK] = pos.attacks_from<ROOK>(ksq);
checkSq[QUEEN] = checkSq[BISHOP] | checkSq[ROOK];
- checkSq[KING] = EmptyBoardBB;
+ checkSq[KING] = 0;
}
/// or the FEN string, we want the new born Position object do not depend
/// on any external data so we detach state pointer from the source one.
-Position::Position(const Position& pos, int th) {
+void Position::copy(const Position& pos, int th) {
memcpy(this, &pos, sizeof(Position));
+ startState = *st;
+ st = &startState;
threadID = th;
nodes = 0;
st->key = key;
// Update checkers bitboard, piece must be already moved
- st->checkersBB = EmptyBoardBB;
+ st->checkersBB = 0;
if (moveIsCheck)
{
if (debugBitboards)
{
// The intersection of the white and black pieces must be empty
- if ((pieces(WHITE) & pieces(BLACK)) != EmptyBoardBB)
+ if (!(pieces(WHITE) & pieces(BLACK)))
return false;
// The union of the white and black pieces must be equal to all