use ConvertValue

if(n == 1), not if(1 == n)
This commit is contained in:
Glenn Maynard
2006-10-20 09:49:58 +00:00
parent 352ad4843d
commit 3f1d7684bb
+1 -1
View File
@@ -363,7 +363,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" )
{
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
if( 1 == sscanf( sValueName, "BGCHANGES%d", (int*)&iLayer ) )
if( sscanf(sValueName, "BGCHANGES%d", ConvertValue<int>(&iLayer)) == 1 )
iLayer = (BackgroundLayer)(iLayer-1); // #BGCHANGES2 = BACKGROUND_LAYER_2
bool bValid = iLayer>=0 && iLayer<NUM_BackgroundLayer;