Fix bug in rebuild occ
All checks were successful
Python tests (make) / test (push) Successful in 12s

We need to init the variables in the loops first.
int p=p doesn't work.
This commit is contained in:
2025-08-19 17:30:01 -04:00
parent 8cecd705a0
commit 44b183bc4d

View File

@@ -604,8 +604,8 @@ void rebuild_occ(struct Board *board) {
uint64_t white=0;
uint64_t black=0;
for (int p = P; p <= K; ++p) white |= board->pieces[p];
for (int p = p; p <= k; ++p) black |= board->pieces[p];
for (int i = P; i <= K; ++i) white |= board->pieces[i];
for (int i = p; i <= k; ++i) black |= board->pieces[i];
board->occ[WHITE] = white;
board->occ[BLACK] = black;