From e17ba826b007b620ef5445c1a8bd9b8e80f28d4c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 19 Jan 2003 21:08:44 +0000 Subject: [PATCH] Fixed crash in demo if no songs. --- stepmania/src/StepMania.cpp | 2 -- stepmania/src/ThemeManager.cpp | 17 ++++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 25da72af58..963512c2f1 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -207,8 +207,6 @@ static void BoostAppPri() if(version.dwMajorVersion >= 5) pri = ABOVE_NORMAL_PRIORITY_CLASS; -#include - /* Be sure to boost the app, not the thread, to make sure the * sound thread stays higher priority than the main thread. */ SetPriorityClass(GetCurrentProcess(), pri); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index e062b007d9..313c595f92 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -326,13 +326,7 @@ try_element_again: goto try_element_again; break; case IDABORT: -#endif - RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.", - sAssetCategory.GetString(), - sFileName.GetString(), - GetThemeDirFromName(m_sCurThemeName).GetString(), - GetThemeDirFromName(BASE_THEME_NAME).GetString() ); -#ifdef _DEBUG + goto abort; case IDIGNORE: LOG->Warn( "Theme element '%s/%s' could not be found in '%s' or '%s'.", @@ -343,6 +337,15 @@ try_element_again: return GetPathTo( sAssetCategory, "_missing" ); } #endif + +abort: + RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.", + sAssetCategory.GetString(), + sFileName.GetString(), + GetThemeDirFromName(m_sCurThemeName).GetString(), + GetThemeDirFromName(BASE_THEME_NAME).GetString() ); + + return ""; }