make invalid conf types non-fatal

This commit is contained in:
Glenn Maynard
2006-07-05 02:39:47 +00:00
parent ed46fef871
commit 9843feb01f
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -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();
@@ -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<RString> &out )
{
vector<const Game*> 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. */