]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Allow Position::init() to be called more than once
[stockfish] / src / position.cpp
index 9db41b784918388f31b9f4d5a3385c043d2ae4f8..5a98821d493dde10d9fe2bd020ba17467c1d7ea5 100644 (file)
@@ -149,6 +149,7 @@ void Position::init() {
 
   for (int cr = NO_CASTLING; cr <= ANY_CASTLING; ++cr)
   {
+      Zobrist::castling[cr] = 0;
       Bitboard b = cr;
       while (b)
       {
@@ -1078,8 +1079,8 @@ Value Position::see(Move m) const {
 }
 
 
-/// Position::is_draw() tests whether the position is drawn by material, 50 moves
-/// rule or repetition. It does not detect stalemates.
+/// Position::is_draw() tests whether the position is drawn by 50-move rule
+/// or by repetition. It does not detect stalemates.
 
 bool Position::is_draw() const {