aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-10-25 23:12:59 -0400
committerkwolekr <kwolekr@minetest.net>2015-10-25 23:15:57 -0400
commitd69ef6acd386ccfd5ff456002591b97b92a26956 (patch)
treef66dabc0f36fb5f123525611987894db2899f3a3
parent54f1267c2c87daea769966c694777a2e5977f870 (diff)
downloadminetest-d69ef6acd386ccfd5ff456002591b97b92a26956.tar.gz
minetest-d69ef6acd386ccfd5ff456002591b97b92a26956.tar.bz2
minetest-d69ef6acd386ccfd5ff456002591b97b92a26956.zip
SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread
-rw-r--r--src/script/lua_api/l_mapgen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 825292419..7adb6a534 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -493,7 +493,7 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L)
EmergeManager *emerge = getServer(L)->getEmergeManager();
Mapgen *mg = emerge->getCurrentMapgen();
if (!mg)
- return 0;
+ throw LuaError("Must only be called in a mapgen thread!");
size_t maplen = mg->csize.X * mg->csize.Z;