pass L to LuaHelpers::TypeError
This commit is contained in:
@@ -414,13 +414,13 @@ void LuaManager::Fail( const CString &err )
|
||||
|
||||
/* Like luaL_typerror, but without the special case for argument 1 being "self"
|
||||
* in method calls, so we give a correct error message after we remove self. */
|
||||
int LuaHelpers::TypeError( int iArgNo, const char *szName )
|
||||
int LuaHelpers::TypeError( Lua *L, int iArgNo, const char *szName )
|
||||
{
|
||||
lua_Debug debug;
|
||||
lua_getstack( LUA->L, 0, &debug );
|
||||
lua_getinfo( LUA->L, "n", &debug );
|
||||
return luaL_error( LUA->L, "bad argument #%d to \"%s\" (%s expected, got %s)",
|
||||
iArgNo, debug.name? debug.name:"(unknown)", szName, lua_typename(LUA->L, lua_type(LUA->L, iArgNo)) );
|
||||
lua_getstack( L, 0, &debug );
|
||||
lua_getinfo( L, "n", &debug );
|
||||
return luaL_error( L, "bad argument #%d to \"%s\" (%s expected, got %s)",
|
||||
iArgNo, debug.name? debug.name:"(unknown)", szName, lua_typename(L, lua_type(L, iArgNo)) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user