diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index a58822c606..9aadb37703 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -50,6 +50,9 @@ bool UnlockSystem::SongIsRoulette( CString sSongName ) return false; } +/* These don't appear to be used. If you need them, I'd suggest making them + * members. They also need return types. */ +#if 0 operator == (const SongEntry &a, const SongEntry &b) { return a.m_sSongName == b.m_sSongName; @@ -79,6 +82,7 @@ operator < (const SongEntry &a, const SongEntry &b) { return a.m_sSongName <= b.m_sSongName; } +#endif SongEntry::SongEntry() { @@ -273,21 +277,17 @@ bool SongEntry::SelectableRoulette() float UnlockSystem::NumPointsUntilNextUnlock() { - float fSmallestPoints; - fSmallestPoints = 4000000000; // or an arbitrarily large value - for( unsigned a=0; a<100; a++ ) + float fSmallestPoints = 400000000; // or an arbitrarily large value + for( unsigned a=0; a= fSmallestPoints ) // new: it makes sure the number of points to the song is positive, AND it is less than // the currently smallest one. (cure) - if( m_SongEntries[a].m_fDancePointsRequired < fSmallestPoints && m_SongEntries[a].m_fDancePointsRequired > PREFSMAN->m_fDancePointsAccumulated) - { - fSmallestPoints = m_SongEntries[a].m_fDancePointsRequired; - } + if( m_SongEntries[a].m_fDancePointsRequired > PREFSMAN->m_fDancePointsAccumulated) + fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired); } - float fResults = (fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated); - return fResults; + return fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated; }