diff options
author | kwolekr <kwolekr@minetest.net> | 2015-10-25 23:12:59 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-10-25 23:15:57 -0400 |
commit | d69ef6acd386ccfd5ff456002591b97b92a26956 (patch) | |
tree | f66dabc0f36fb5f123525611987894db2899f3a3 /src/script/lua_api | |
parent | 54f1267c2c87daea769966c694777a2e5977f870 (diff) | |
download | minetest-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
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 2 |
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; |