minor fixes

This commit is contained in:
2025-12-21 09:01:09 +01:00
parent a1f16a7d94
commit f3064e9dad
3 changed files with 36 additions and 7 deletions

View File

@ -685,6 +685,13 @@ void TetrisApp::Impl::runLoop()
challengeClearFxOrder.push_back(idx);
}
}
// Seed FX RNG deterministically from the game's challenge seed so animations
// are reproducible per-run and per-level. Fall back to a random seed if game absent.
if (game) {
challengeClearFxRng.seed(game->getChallengeSeedBase() + static_cast<uint32_t>(nextLevel));
} else {
challengeClearFxRng.seed(std::random_device{}());
}
std::shuffle(challengeClearFxOrder.begin(), challengeClearFxOrder.end(), challengeClearFxRng);
challengeClearFxElapsedMs = 0.0;