1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improve Script CPP API diagnostics

This commit is contained in:
kwolekr 2015-08-05 00:49:35 -04:00
parent 3183d5a403
commit bcf47bc67c
16 changed files with 129 additions and 107 deletions

View file

@ -77,8 +77,9 @@ void LuaABM::trigger(ServerEnvironment *env, v3s16 p, MapNode n,
pushnode(L, n, env->getGameDef()->ndef());
lua_pushnumber(L, active_object_count);
lua_pushnumber(L, active_object_count_wider);
if(lua_pcall(L, 4, 0, errorhandler))
script_error(L);
PCALL_RESL(L, lua_pcall(L, 4, 0, errorhandler));
lua_pop(L, 1); // Pop error handler
}
@ -418,8 +419,9 @@ int ModApiEnvMod::l_add_item(lua_State *L)
return 0;
lua_pushvalue(L, 1);
lua_pushstring(L, item.getItemString().c_str());
if(lua_pcall(L, 2, 1, errorhandler))
script_error(L);
PCALL_RESL(L, lua_pcall(L, 2, 1, errorhandler));
lua_remove(L, errorhandler); // Remove error handler
return 1;
}