use ConvertValue
if(n == 1), not if(1 == n)
This commit is contained in:
@@ -363,7 +363,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
|
|||||||
else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" )
|
else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" )
|
||||||
{
|
{
|
||||||
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
|
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
|
iLayer = (BackgroundLayer)(iLayer-1); // #BGCHANGES2 = BACKGROUND_LAYER_2
|
||||||
|
|
||||||
bool bValid = iLayer>=0 && iLayer<NUM_BackgroundLayer;
|
bool bValid = iLayer>=0 && iLayer<NUM_BackgroundLayer;
|
||||||
|
|||||||
Reference in New Issue
Block a user