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:
+17
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user