bring RunExpression and RunScript closer together

This commit is contained in:
Glenn Maynard
2005-02-15 02:02:08 +00:00
parent 22eee805b9
commit 2103eb0531
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -301,7 +301,7 @@ bool LuaManager::RunScript( const CString &sScript, int iReturnValues )
} }
bool LuaManager::RunExpression( const CString &str ) bool LuaManager::RunExpression( const CString &str, int iReturnValues )
{ {
// load string // load string
{ {
@@ -324,7 +324,7 @@ bool LuaManager::RunExpression( const CString &str )
// evaluate // evaluate
{ {
int ret = lua_pcall(L, 0, 1, 0); int ret = lua_pcall( L, 0, iReturnValues, 0 );
if( ret ) if( ret )
{ {
CString err; CString err;
+1 -1
View File
@@ -56,7 +56,7 @@ public:
static void ReadArrayFromTable( vector<bool> &aOut, lua_State *L = NULL ); static void ReadArrayFromTable( vector<bool> &aOut, lua_State *L = NULL );
/* Run an expression. The result is left on the Lua stack. */ /* Run an expression. The result is left on the Lua stack. */
bool RunExpression( const CString &str ); bool RunExpression( const CString &str, int iReturnValues = 1 );
lua_State *L; lua_State *L;
}; };