#include "environment.h"
#include "mapgen.h"
#include "lua_api/l_env.h"
+#include "server.h"
void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp,
u32 blockseed)
lua_getfield(L, -1, "registered_globalsteps");
// Call callbacks
lua_pushnumber(L, dtime);
- script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ try {
+ script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
+ } catch (LuaError &e) {
+ getServer()->setAsyncFatalError(e.what());
+ }
}
void ScriptApiEnv::environment_OnMapgenInit(MapgenParams *mgparams)