From 2103eb0531b4a47430cc5298f25556bc2a3f90c8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 15 Feb 2005 02:02:08 +0000 Subject: [PATCH] bring RunExpression and RunScript closer together --- stepmania/src/LuaManager.cpp | 4 ++-- stepmania/src/LuaManager.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index febb8dafef..dc09a27671 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -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 { @@ -324,7 +324,7 @@ bool LuaManager::RunExpression( const CString &str ) // evaluate { - int ret = lua_pcall(L, 0, 1, 0); + int ret = lua_pcall( L, 0, iReturnValues, 0 ); if( ret ) { CString err; diff --git a/stepmania/src/LuaManager.h b/stepmania/src/LuaManager.h index 780e2669ae..a0e3f01241 100644 --- a/stepmania/src/LuaManager.h +++ b/stepmania/src/LuaManager.h @@ -56,7 +56,7 @@ public: static void ReadArrayFromTable( vector &aOut, lua_State *L = NULL ); /* 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; };