don't use 0 and 1 for bools; use valid Lua expressions
This commit is contained in:
@@ -932,15 +932,9 @@ bool ThemeManager::GetMetricB( const RString &sClassName, const RString &sValueN
|
|||||||
|
|
||||||
LuaHelpers::RunAtExpressionS( sValue );
|
LuaHelpers::RunAtExpressionS( sValue );
|
||||||
|
|
||||||
/* Watch out: "0" and "1" are not false and true in Lua (all string values are
|
if( sValue.Left(1) == "0" || sValue.Left(1) == "1" )
|
||||||
* true). Make sure that we catch all values that are supposed to be simple
|
RageException::Throw( "Theme metric %s::%s: boolean value \"%s\" should be true or false",
|
||||||
* booleans. */
|
sClassName.c_str(), sValueName.c_str(), sValue.c_str() );
|
||||||
TrimLeft( sValue );
|
|
||||||
TrimRight( sValue );
|
|
||||||
if( sValue.Left(1) == "0" )
|
|
||||||
return false; /* optimization */
|
|
||||||
if( sValue.Left(1) == "1" )
|
|
||||||
return true; /* optimization */
|
|
||||||
|
|
||||||
LuaHelpers::PrepareExpression( sValue );
|
LuaHelpers::PrepareExpression( sValue );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user