From 7831c42c8318f3baaec8f6d0eee607a832401e61 Mon Sep 17 00:00:00 2001 From: Michael Votaw Date: Mon, 12 Feb 2024 18:12:58 -0600 Subject: [PATCH] Instead of calling rnd(), just select the average between iMaxDist and iMinDist. This fixes an issue where a Course entry that only specifies a meter range will potentially select different songs for each difficulty. --- src/Course.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Course.cpp b/src/Course.cpp index 007269ec08..86f956be86 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -638,8 +638,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) if( iMaxDist == iMinDist ) iAdd = iMaxDist; else { - std::uniform_int_distribution<> dist( iMinDist, iMaxDist ); - iAdd = dist( rnd ); + iAdd = std::floor((iMinDist + iMaxDist) / 2); } iLowMeter += iAdd; iHighMeter += iAdd; @@ -871,8 +870,7 @@ void Course::GetTrailUnsortedEndless( const std::vector &entries, T if( iMaxDist == iMinDist ) iAdd = iMaxDist; else { - std::uniform_int_distribution<> dist( iMinDist, iMaxDist ); - iAdd = dist( rnd ); + iAdd = std::floor((iMinDist + iMaxDist) / 2); } iLowMeter += iAdd; iHighMeter += iAdd;