From 544ba3bf205d79392ce8f86906972cdeb0f354ed Mon Sep 17 00:00:00 2001 From: Edwin Jarvis Date: Mon, 11 May 2026 15:23:37 +0800 Subject: [PATCH] cellMusic: Fix shuffle always producing the same order The shuffle in step_track() used std::default_random_engine with a default (fixed) seed, causing the playlist to be 'shuffled' into the same deterministic order every time. Use std::random_device to seed the engine so each shuffle produces a genuinely random order. Fixes #18672 --- rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp b/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp index ae578d2329..42f4a0fb6f 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp @@ -362,7 +362,8 @@ u32 music_selection_context::step_track(bool next) { // We reached the first or last track again. Let's shuffle! cellMusicSelectionContext.notice("step_track: Shuffling playlist..."); - auto engine = std::default_random_engine{}; + std::random_device rd; + auto engine = std::default_random_engine{rd()}; std::shuffle(std::begin(playlist), std::end(playlist), engine); } }