Browse Source

fixed: using wrong index at the nStartingRow array

feature/2015
Christian Kroll 14 years ago
parent
commit
8c92d54ff6
  1. 4
      games/tetris/variant_bastet.c

4
games/tetris/variant_bastet.c

@ -78,6 +78,7 @@ void tetris_bastet_doPreprocessing(tetris_bastet_variant_t *pBastet)
pBastet->pColScore[t0] > pBastet->pColScore[t1] ? pBastet->pColScore[t0] > pBastet->pColScore[t1] ?
pBastet->pColScore[t0] : pBastet->pColScore[t1]; pBastet->pColScore[t0] : pBastet->pColScore[t1];
} }
// normalize to bucket geometry // normalize to bucket geometry
for (uint8_t i = 0; i < nWidth + 3; ++i) for (uint8_t i = 0; i < nWidth + 3; ++i)
{ {
@ -255,7 +256,7 @@ int16_t tetris_bastet_evaluateMove(tetris_bastet_variant_t *pBastet,
// the row where the given piece collides // the row where the given piece collides
int8_t nDeepestRow = tetris_bucket_predictDeepestRow(pBastet->pBucket, int8_t nDeepestRow = tetris_bucket_predictDeepestRow(pBastet->pBucket,
pPiece, pBastet->pStartingRow[nColumn], nColumn); pPiece, pBastet->pStartingRow[nColumn + 3], nColumn);
// in case the prediction fails we return the lowest possible score // in case the prediction fails we return the lowest possible score
if (nDeepestRow == TETRIS_BUCKET_INVALIDROW) if (nDeepestRow == TETRIS_BUCKET_INVALIDROW)
@ -320,7 +321,6 @@ void tetris_bastet_evaluatePieces(tetris_bastet_variant_t *pBastet)
for (int8_t nAngle = TETRIS_PC_ANGLE_0; nAngle < nAngleCount; ++nAngle) for (int8_t nAngle = TETRIS_PC_ANGLE_0; nAngle < nAngleCount; ++nAngle)
{ {
tetris_piece_setAngle(pPiece, nAngle); tetris_piece_setAngle(pPiece, nAngle);
tetris_piece_rotate(pPiece, TETRIS_PC_ROT_CW);
for (int8_t nCol = -3; nCol < nWidth; ++nCol) for (int8_t nCol = -3; nCol < nWidth; ++nCol)
{ {
int16_t nScore = tetris_bastet_evaluateMove(pBastet, int16_t nScore = tetris_bastet_evaluateMove(pBastet,

Loading…
Cancel
Save