remove LuaManager::PushNopFunction(). Just compile an empty function;

it'll be tiny, anyway.
This commit is contained in:
Glenn Maynard
2005-02-15 01:49:03 +00:00
parent d9e71d7798
commit 831e7c1825
3 changed files with 0 additions and 20 deletions
-7
View File
@@ -14,13 +14,6 @@ ActorCommands::ActorCommands( const Commands& cmds )
void ActorCommands::Register()
{
if( m_cmds.v.size() == 0 )
{
LUA->PushNopFunction();
this->SetFromStack();
return;
}
//
// Convert cmds to a Lua function
//
-11
View File
@@ -59,13 +59,6 @@ void LuaManager::PushStackNil()
lua_pushnil( L );
}
void LuaManager::PushNopFunction()
{
lua_rawgeti( LUA->L, LUA_REGISTRYINDEX, m_iNopFunction );
ASSERT_M( !lua_isnil(L, -1), ssprintf("%i", m_iNopFunction) )
}
void LuaManager::PushStack( int out, lua_State *L )
{
if( L == NULL )
@@ -221,10 +214,6 @@ void LuaManager::ResetState()
luaopen_string( L );
lua_settop(L, 0); // luaopen_* pushes stuff onto the stack that we don't need
/* Set up the NOP function pointer. */
RunScript( "return function() end", 1 );
m_iNopFunction = luaL_ref( L, LUA_REGISTRYINDEX );
for( const LuaFunctionList *p = g_LuaFunctions; p; p=p->next )
lua_register( L, p->name, p->func );
-2
View File
@@ -58,8 +58,6 @@ public:
/* Run an expression. The result is left on the Lua stack. */
bool RunExpression( const CString &str );
lua_State *L;
private:
int m_iNopFunction;
};
extern LuaManager *LUA;