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:
+2
-4
@@ -638,8 +638,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
if( iMaxDist == iMinDist )
|
if( iMaxDist == iMinDist )
|
||||||
iAdd = iMaxDist;
|
iAdd = iMaxDist;
|
||||||
else {
|
else {
|
||||||
std::uniform_int_distribution<> dist( iMinDist, iMaxDist );
|
iAdd = std::floor((iMinDist + iMaxDist) / 2);
|
||||||
iAdd = dist( rnd );
|
|
||||||
}
|
}
|
||||||
iLowMeter += iAdd;
|
iLowMeter += iAdd;
|
||||||
iHighMeter += iAdd;
|
iHighMeter += iAdd;
|
||||||
@@ -871,8 +870,7 @@ void Course::GetTrailUnsortedEndless( const std::vector<CourseEntry> &entries, T
|
|||||||
if( iMaxDist == iMinDist )
|
if( iMaxDist == iMinDist )
|
||||||
iAdd = iMaxDist;
|
iAdd = iMaxDist;
|
||||||
else {
|
else {
|
||||||
std::uniform_int_distribution<> dist( iMinDist, iMaxDist );
|
iAdd = std::floor((iMinDist + iMaxDist) / 2);
|
||||||
iAdd = dist( rnd );
|
|
||||||
}
|
}
|
||||||
iLowMeter += iAdd;
|
iLowMeter += iAdd;
|
||||||
iHighMeter += iAdd;
|
iHighMeter += iAdd;
|
||||||
|
|||||||
Reference in New Issue
Block a user