forked from Mirrorlandia_minetest/minetest
SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread
This commit is contained in:
parent
54f1267c2c
commit
d69ef6acd3
@ -493,7 +493,7 @@ int ModApiMapgen::l_get_mapgen_object(lua_State *L)
|
|||||||
EmergeManager *emerge = getServer(L)->getEmergeManager();
|
EmergeManager *emerge = getServer(L)->getEmergeManager();
|
||||||
Mapgen *mg = emerge->getCurrentMapgen();
|
Mapgen *mg = emerge->getCurrentMapgen();
|
||||||
if (!mg)
|
if (!mg)
|
||||||
return 0;
|
throw LuaError("Must only be called in a mapgen thread!");
|
||||||
|
|
||||||
size_t maplen = mg->csize.X * mg->csize.Z;
|
size_t maplen = mg->csize.X * mg->csize.Z;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user