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.
This commit is contained in:
Michael Votaw
2024-03-06 01:45:26 -08:00
committed by teejusb
parent d73e210f57
commit 7831c42c83
+2 -4
View File
@@ -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<CourseEntry> &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;