Fixed Course::GetTotalSeconds to work on courses that don't have a medium difficulty. A course with only double charts was probably the one that made the crash manifest.

This commit is contained in:
Kyzentun
2014-07-23 13:25:04 -06:00
parent 84766a7cff
commit ba0a0c69d2
+17 -2
View File
@@ -823,9 +823,24 @@ bool Course::GetTotalSeconds( StepsType st, float& fSecondsOut ) const
if( !AllSongsAreFixed() )
return false;
Trail* pTrail = GetTrail( st, Difficulty_Medium );
Trail* trail = GetTrail( st, Difficulty_Medium );
if(!trail)
{
for(int cd= 0; cd < NUM_CourseDifficulty; ++cd)
{
trail= GetTrail(st, (CourseDifficulty)cd);
if(trail)
{
break;
}
}
if(!trail)
{
return false;
}
}
fSecondsOut = pTrail->GetLengthSeconds();
fSecondsOut = trail->GetLengthSeconds();
return true;
}