mirror of
https://github.com/minetest/minetest.git
synced 2024-11-10 01:33:46 +01:00
Handle Lua errors in on_generate callbacks instead of throwing SIGABRT
This commit is contained in:
parent
c3708b456e
commit
15c316765d
@ -554,9 +554,11 @@ void *EmergeThread::Thread() {
|
|||||||
MapEditEventAreaIgnorer
|
MapEditEventAreaIgnorer
|
||||||
ign(&m_server->m_ignore_map_edit_events_area,
|
ign(&m_server->m_ignore_map_edit_events_area,
|
||||||
VoxelArea(minp, maxp));
|
VoxelArea(minp, maxp));
|
||||||
{ // takes about 90ms with -O1 on an e3-1230v2
|
try { // takes about 90ms with -O1 on an e3-1230v2
|
||||||
m_server->getScriptIface()->environment_OnGenerated(
|
m_server->getScriptIface()->environment_OnGenerated(
|
||||||
minp, maxp, emerge->getBlockSeed(minp));
|
minp, maxp, emerge->getBlockSeed(minp));
|
||||||
|
} catch(LuaError &e) {
|
||||||
|
m_server->setAsyncFatalError(e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
|
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
|
||||||
|
Loading…
Reference in New Issue
Block a user