mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Allow Position::init() to be called multiple times.
For the rationale to allow this, see commit
a66c73deef
This was broken when cuckoo hashing was added, and
subtly broke (for example) lichess' Android application,
thus illustrating the original judgement was sound.
No functional change.
This commit is contained in:
committed by
Stéphane Nicolet
parent
a6fa6a9e92
commit
e0f317afaa
@@ -168,6 +168,8 @@ void Position::init() {
|
|||||||
Zobrist::noPawns = rng.rand<Key>();
|
Zobrist::noPawns = rng.rand<Key>();
|
||||||
|
|
||||||
// Prepare the cuckoo tables
|
// Prepare the cuckoo tables
|
||||||
|
std::memset(cuckoo, 0, sizeof(cuckoo));
|
||||||
|
std::memset(cuckooMove, 0, sizeof(cuckooMove));
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Piece pc : Pieces)
|
for (Piece pc : Pieces)
|
||||||
for (Square s1 = SQ_A1; s1 <= SQ_H8; ++s1)
|
for (Square s1 = SQ_A1; s1 <= SQ_H8; ++s1)
|
||||||
|
|||||||
Reference in New Issue
Block a user