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:
Glenn Maynard
2005-02-17 05:46:31 +00:00
parent d66163ab74
commit 6f88bf18c0
3 changed files with 18 additions and 11 deletions
+6 -2
View File
@@ -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();