aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-12-14 01:59:16 -0500
committerkwolekr <kwolekr@minetest.net>2013-12-14 01:59:16 -0500
commit15c316765d2ee2a0b8aec78fd6b13d9367f3c91e (patch)
tree45154269e5c4c4889ef5e813d33b2c692f6d63f5
parentc3708b456e90bccf19e7c82c54a93c8cb7c8896c (diff)
downloadminetest-15c316765d2ee2a0b8aec78fd6b13d9367f3c91e.tar.gz
minetest-15c316765d2ee2a0b8aec78fd6b13d9367f3c91e.tar.bz2
minetest-15c316765d2ee2a0b8aec78fd6b13d9367f3c91e.zip
Handle Lua errors in on_generate callbacks instead of throwing SIGABRT
-rw-r--r--src/emerge.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp
index f096bb874..2f757a760 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -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));