fix DIFFICULTY_INVALID used as a valid value

This commit is contained in:
Chris Danford
2006-07-14 20:26:11 +00:00
parent 8b3f014a73
commit 691d852d68
+8 -5
View File
@@ -1349,12 +1349,15 @@ void ScreenSelectMusic::SwitchToPreferredDifficulty()
break; break;
} }
int iDiff = abs(m_vpSteps[i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[pn]); if( GAMESTATE->m_PreferredDifficulty[pn] != DIFFICULTY_INVALID )
if( iCurDifference == -1 || iDiff < iCurDifference )
{ {
iSelection = i; int iDiff = abs(m_vpSteps[i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[pn]);
iCurDifference = iDiff;
if( iCurDifference == -1 || iDiff < iCurDifference )
{
iSelection = i;
iCurDifference = iDiff;
}
} }
} }