]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Restore std::cout instead of printf()
[stockfish] / src / position.cpp
index 2f18427d827f8111d0357416d92525bb4ad7bb72..66890a5f5e2224473d81f4a20d6ab3b8b0937814 100644 (file)
@@ -89,7 +89,7 @@ CheckInfo::CheckInfo(const Position& pos) {
   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;
 }
 
 
@@ -100,6 +100,8 @@ CheckInfo::CheckInfo(const Position& pos) {
 void Position::copy(const Position& pos, int th) {
 
   memcpy(this, &pos, sizeof(Position));
+  startState = *st;
+  st = &startState;
   threadID = th;
   nodes = 0;
 
@@ -931,7 +933,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   st->key = key;
 
   // Update checkers bitboard, piece must be already moved
-  st->checkersBB = EmptyBoardBB;
+  st->checkersBB = 0;
 
   if (moveIsCheck)
   {
@@ -1697,7 +1699,7 @@ bool Position::pos_is_ok(int* failedStep) const {
   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