1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Fix pieceList initialization in Position::clear()

We want piece list to be terminated with SQ_NONE.

This happens with all the pieces but the pawns that
being 8 make the inner loop exit just before writing
the SQ_NONE value at the tail of the list.

This bug was hidden because currently we don't use
piece list to scan pawns, but this will change in the
future and in any case an initialization should be done
correctly for the whole array to avoid subtle bugs in
the future.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-10-10 09:48:02 +01:00
parent ccdb634b77
commit a806d7c3d6

View file

@ -1488,8 +1488,8 @@ void Position::clear() {
for (int i = 0; i < 64; i++)
board[i] = EMPTY;
for (int i = 0; i < 7; i++)
for (int j = 0; j < 8; j++)
for (int i = 0; i < 8; i++)
for (int j = 0; j < 16; j++)
pieceList[0][i][j] = pieceList[1][i][j] = SQ_NONE;
sideToMove = WHITE;