From 76815a824247dee001696017e86c77fe4d20adc1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 13 Apr 2003 02:58:59 +0000 Subject: [PATCH] BGAnimations layer numbers need not be consecutive --- stepmania/src/BGAnimation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index 380a324d6e..16032ab993 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -20,6 +20,7 @@ #include "song.h" #include "ThemeManager.h" +const int MAX_LAYERS = 100; BGAnimation::BGAnimation() { @@ -68,12 +69,12 @@ void BGAnimation::LoadFromAniDir( CString sAniDir ) ini.GetValueF( "BGAnimation", "LengthSeconds", m_fLengthSeconds ); unsigned i; - for( i=0; true; i++ ) + for( i=0; MAX_LAYERS; i++ ) { CString sLayer = ssprintf("Layer%d",i+1); const IniFile::key* pKey = ini.GetKey( sLayer ); if( pKey == NULL ) - break; + continue; // skip BGAnimationLayer* pLayer = new BGAnimationLayer; pLayer->LoadFromIni( sAniDir, sLayer ); m_Layers.push_back( pLayer );