From: kwolekr Date: Mon, 26 Oct 2015 03:12:59 +0000 (-0400) Subject: SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread X-Git-Tag: 0.4.14~565 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d69ef6acd386ccfd5ff456002591b97b92a26956;p=oweals%2Fminetest.git SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread --- 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;