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

SAPI: Track last executed mod and include in error messages

This commit is contained in:
kwolekr 2015-08-11 22:27:54 -04:00
parent 738fbc66d0
commit 2b04ab874d
19 changed files with 231 additions and 45 deletions

View file

@ -38,7 +38,7 @@ void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp,
push_v3s16(L, minp);
push_v3s16(L, maxp);
lua_pushnumber(L, blockseed);
script_run_callbacks(L, 3, RUN_CALLBACKS_MODE_FIRST);
runCallbacks(3, RUN_CALLBACKS_MODE_FIRST);
}
void ScriptApiEnv::environment_Step(float dtime)
@ -52,7 +52,7 @@ void ScriptApiEnv::environment_Step(float dtime)
// Call callbacks
lua_pushnumber(L, dtime);
try {
script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
} catch (LuaError &e) {
getServer()->setAsyncFatalError(e.what());
}
@ -73,7 +73,7 @@ void ScriptApiEnv::player_event(ServerActiveObject* player, std::string type)
objectrefGetOrCreate(L, player); // player
lua_pushstring(L,type.c_str()); // event type
try {
script_run_callbacks(L, 2, RUN_CALLBACKS_MODE_FIRST);
runCallbacks(2, RUN_CALLBACKS_MODE_FIRST);
} catch (LuaError &e) {
getServer()->setAsyncFatalError(e.what());
}