assert on invalid enum strings early

This commit is contained in:
Chris Danford
2005-02-14 17:51:57 +00:00
parent f747571c29
commit 98cee78b78
+2
View File
@@ -137,6 +137,7 @@ void ScreenOptionsMaster::SetLua( OptionRowDefinition &row, OptionRowHandler &ha
if( pStr == NULL )
RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string", sLuaFunction.c_str() );
row.layoutType = StringToLayoutType( pStr );
ASSERT( row.layoutType != LAYOUT_INVALID );
lua_pop( LUA->L, 1 );
lua_pushstring( LUA->L, "SelectType" );
@@ -145,6 +146,7 @@ void ScreenOptionsMaster::SetLua( OptionRowDefinition &row, OptionRowHandler &ha
if( pStr == NULL )
RageException::Throw( "\"%s\" \"SelectType\" entry is not a string", sLuaFunction.c_str() );
row.selectType = StringToSelectType( pStr );
ASSERT( row.selectType != SELECT_INVALID );
lua_pop( LUA->L, 1 );
/* Iterate over the "Choices" table. */