Cleanup: change RunExpression to a RunScript helper. Never tack on
"return "; the caller can do that if it wants. Instead, just act as a helper to display a generic dialog on error.
This commit is contained in:
@@ -113,13 +113,17 @@ void LuaReference::ReRegister()
|
||||
|
||||
void LuaExpression::SetFromExpression( const CString &sExpression )
|
||||
{
|
||||
m_sExpression = sExpression;
|
||||
m_sExpression = "return " + sExpression;
|
||||
Register();
|
||||
}
|
||||
|
||||
void LuaExpression::Register()
|
||||
{
|
||||
LUA->RunExpression( m_sExpression );
|
||||
if( !LUA->RunScript( m_sExpression ) )
|
||||
{
|
||||
this->SetFromNil();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Store the result. */
|
||||
this->SetFromStack();
|
||||
|
||||
Reference in New Issue
Block a user