Lua: Fixed an error in table-functions callbacks.
This commit is contained in:
parent
07fb1bca23
commit
b61a74d6a2
@ -289,9 +289,13 @@ bool cLuaState::PushFunction(const cTableRef & a_TableRef)
|
|||||||
if (lua_isnil(m_LuaState, -1) || !lua_isfunction(m_LuaState, -1))
|
if (lua_isnil(m_LuaState, -1) || !lua_isfunction(m_LuaState, -1))
|
||||||
{
|
{
|
||||||
// Not a valid function, bail out
|
// Not a valid function, bail out
|
||||||
lua_pop(m_LuaState, 2);
|
lua_pop(m_LuaState, 3);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pop the table off the stack:
|
||||||
|
lua_remove(m_LuaState, -2);
|
||||||
|
|
||||||
Printf(m_CurrentFunctionName, "<table-callback %s>", a_TableRef.GetFnName());
|
Printf(m_CurrentFunctionName, "<table-callback %s>", a_TableRef.GetFnName());
|
||||||
m_NumCurrentFunctionArgs = 0;
|
m_NumCurrentFunctionArgs = 0;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user