1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00: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:
Gian-Carlo Pascutto 2018-07-17 23:13:12 +02:00 committed by Stéphane Nicolet
parent a6fa6a9e92
commit e0f317afaa

View 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)