From d69ef6acd386ccfd5ff456002591b97b92a26956 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 25 Oct 2015 23:12:59 -0400 Subject: SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread --- src/script/lua_api/l_mapgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script/lua_api') 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; -- cgit v1.2.3