From ffd790a834091dd834f7ea240968d58d6396e888 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 14 Jun 2006 09:59:58 +0000 Subject: [PATCH] Remove superfluous check--StringToFloat does it already. Ensure 0 < low meter <= high meter. Do not throw if we cannot read the course file, merely note it in the log. --- stepmania/src/CourseLoaderCRS.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index a41f294db1..e5f930d799 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -63,9 +63,6 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou else if( 0 == stricmp(sValueName, "GAINSECONDS") ) { fGainSeconds = StringToFloat( sParams[1] ); - - if( !finite(fGainSeconds) ) - fGainSeconds = 0.0f; } else if( 0 == stricmp(sValueName, "METER") ) { @@ -225,6 +222,8 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou new_entry.stepsCriteria.m_iLowMeter = 3; new_entry.stepsCriteria.m_iHighMeter = 6; } + new_entry.stepsCriteria.m_iLowMeter = max( new_entry.stepsCriteria.m_iLowMeter, 1 ); + new_entry.stepsCriteria.m_iHighMeter = max( new_entry.stepsCriteria.m_iHighMeter, new_entry.stepsCriteria.m_iLowMeter ); } { @@ -341,7 +340,11 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out ) MsdFile msd; if( !msd.ReadFile(sPath) ) - RageException::Throw( "Error opening CRS file '%s'.", sPath.c_str() ); + { + + LOG->Trace( "Error opening CRS file '%s': %s.", sPath.c_str(), msd.GetError().c_str() ); + return false; + } if( !LoadFromMsd(sPath, msd, out, bUseCache) ) return false;