Skip to content

Commit

Permalink
Handle Lua errors in on_generate callbacks instead of throwing SIGABRT
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Dec 14, 2013
1 parent c3708b4 commit 15c3167
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/emerge.cpp
Expand Up @@ -554,9 +554,11 @@ void *EmergeThread::Thread() {
MapEditEventAreaIgnorer
ign(&m_server->m_ignore_map_edit_events_area,
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(
minp, maxp, emerge->getBlockSeed(minp));
} catch(LuaError &e) {
m_server->setAsyncFatalError(e.what());
}

EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
Expand Down

0 comments on commit 15c3167

Please sign in to comment.