}
+bool EmergeManager::isRunning()
+{
+ return m_threads_active;
+}
+
+
bool EmergeManager::enqueueBlockEmerge(
u16 peer_id,
v3s16 blockpos,
if (!lua_istable(L, 1))
return 0;
- MapgenParams *params = &getServer(L)->getEmergeManager()->params;
+ EmergeManager *emerge = getServer(L)->getEmergeManager();
+ if (emerge->isRunning())
+ throw LuaError("Cannot set parameters while mapgen is running");
+
+ MapgenParams *params = &emerge->params;
u32 flags = 0, flagmask = 0;
lua_getfield(L, 1, "mgname");
if (lua_isnumber(L, -1))
params->water_level = lua_tointeger(L, -1);
+ lua_getfield(L, 1, "chunksize");
+ if (lua_isnumber(L, -1))
+ params->chunksize = lua_tointeger(L, -1);
+
warn_if_field_exists(L, 1, "flagmask",
"Deprecated: flags field now includes unset flags.");
lua_getfield(L, 1, "flagmask");