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:
parent
ccdb634b77
commit
a806d7c3d6
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue