]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Allow Position::init() to be called multiple times.
[stockfish] / src / position.cpp
index 29a2b314741f8f5db6ebc920d8c76c2881cf8a37..84c7ae8f1c65539101650b68492fe4a902de8f7d 100644 (file)
@@ -168,6 +168,8 @@ void Position::init() {
   Zobrist::noPawns = rng.rand<Key>();
 
   // Prepare the cuckoo tables
+  std::memset(cuckoo, 0, sizeof(cuckoo));
+  std::memset(cuckooMove, 0, sizeof(cuckooMove));
   int count = 0;
   for (Piece pc : Pieces)
       for (Square s1 = SQ_A1; s1 <= SQ_H8; ++s1)