summaryrefslogtreecommitdiff
path: root/src/testsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testsup.c')
-rw-r--r--src/testsup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/testsup.c b/src/testsup.c
index d1b102d..852b6d9 100644
--- a/src/testsup.c
+++ b/src/testsup.c
@@ -117,7 +117,8 @@ GenerateRandomLegalPosition(POSITION *pos)
pos->uNonPawnCount[WHITE][KING] = 1;
pos->uNonPawnCount[WHITE][0] = 1;
pos->uNonPawnMaterial[WHITE] = VALUE_KING;
-
+ pos->bbOccupied |= COOR_TO_BB(c);
+
do
{
c1 = RANDOM_COOR;
@@ -130,7 +131,8 @@ GenerateRandomLegalPosition(POSITION *pos)
pos->uNonPawnCount[BLACK][KING] = 1;
pos->uNonPawnCount[BLACK][0] = 1;
pos->uNonPawnMaterial[BLACK] = VALUE_KING;
-
+ pos->bbOccupied |= COOR_TO_BB(c1);
+
//
// Place the rest of the armies
//
@@ -180,6 +182,7 @@ GenerateRandomLegalPosition(POSITION *pos)
pos->uPawnCount[uColor]++;
pos->uPawnMaterial[uColor] += VALUE_PAWN;
pos->bbPawns[uColor] |= COOR_TO_BB(c);
+ pos->bbOccupied |= COOR_TO_BB(c);
break;
}
else if (!IS_KING(p) &&
@@ -193,6 +196,7 @@ GenerateRandomLegalPosition(POSITION *pos)
pos->rgSquare[c].uIndex = uIndex;
pos->uNonPawnMaterial[uColor] += PIECE_VALUE(p);
pos->bbPieces[uColor][PIECE_TYPE(p)] |= COOR_TO_BB(c);
+ pos->bbOccupied |= COOR_TO_BB(c);
if (IS_BISHOP(p))
{
if (IS_WHITE_SQUARE_COOR(c))