mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-17 05:13:25 +00:00
fix random splash file selection logic in SplashScreenView (#2999)
This commit is contained in:
@@ -1089,7 +1089,7 @@ void SplashScreenView::get_random_splash_file(std::filesystem::path& path) {
|
||||
(ext[3] == 'P' || ext[3] == 'p')) {
|
||||
valid_count++;
|
||||
// Reservoir Sampling:
|
||||
if ((myrand(&rng_state) % valid_count) == 0) {
|
||||
if (((rng_state = myrand(&rng_state)) % valid_count) == 0) {
|
||||
path = splash_dir / fno.fname;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user