From 9843feb01f88ddce94bed3af8eabe0542bc998cd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 5 Jul 2006 02:39:47 +0000 Subject: [PATCH] make invalid conf types non-fatal --- stepmania/src/OptionRowHandler.cpp | 6 +++++- stepmania/src/ScreenOptionsMasterPrefs.cpp | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index e94e7026ef..0d2252a70f 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -997,7 +997,11 @@ public: ConfOption *pConfOption = ConfOption::Find( sParam ); if( pConfOption == NULL ) - RageException::Throw( "Invalid Conf type \"%s\"", sParam.c_str() ); + { + LOG->Warn( "Invalid Conf type \"%s\"", sParam.c_str() ); + pConfOption = ConfOption::Find( "Invalid" ); + ASSERT_M( pConfOption != NULL, "ConfOption::Find(Invalid)" ); + } pConfOption->UpdateAvailableOptions(); diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 031cc36ace..e4a0697631 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -120,6 +120,12 @@ static void MovePref( int &iSel, bool bToSel, const ConfOption *pConfOption ) } } +static void MoveNop( int &iSel, bool bToSel, const ConfOption *pConfOption ) +{ + if( bToSel ) + iSel = 0; +} + static void GameChoices( vector &out ) { vector aGames; @@ -684,6 +690,8 @@ static void InitializeConfOptions() /* Editor options */ ADD( ConfOption( "EditorShowBGChangesPlay", MovePref, "Hide","Show") ); + + ADD( ConfOption( "Invalid", MoveNop, "|Invalid option") ); } /* Get a mask of effects to apply if the given option changes. */