From db4ea4658c58772ee447ff0eff8bb39b692081ec Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 15 Apr 2014 13:30:46 -0400 Subject: Only push the Lua error handler once --- src/script/cpp_api/s_entity.cpp | 75 ++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 43 deletions(-) (limited to 'src/script/cpp_api/s_entity.cpp') diff --git a/src/script/cpp_api/s_entity.cpp b/src/script/cpp_api/s_entity.cpp index c9d1bd8e0..8e79f8838 100644 --- a/src/script/cpp_api/s_entity.cpp +++ b/src/script/cpp_api/s_entity.cpp @@ -39,7 +39,7 @@ bool ScriptApiEntity::luaentity_Add(u16 id, const char *name) lua_gettable(L, -2); // Should be a table, which we will use as a prototype //luaL_checktype(L, -1, LUA_TTABLE); - if(lua_type(L, -1) != LUA_TTABLE){ + if (lua_type(L, -1) != LUA_TTABLE){ errorstream<<"LuaEntity name \""<weight); lua_getfield(L, -1, "collisionbox"); - if(lua_istable(L, -1)) + if (lua_istable(L, -1)) prop->collisionbox = read_aabb3f(L, -1, 1.0); lua_pop(L, 1); @@ -199,9 +194,6 @@ void ScriptApiEntity::luaentity_Step(u16 id, float dtime) { SCRIPTAPI_PRECHECKHEADER - lua_pushcfunction(L, script_error_handler); - int errorhandler = lua_gettop(L); - //infostream<<"scriptapi_luaentity_step: id="<