Various bugfixes and workarounds

Now working in pure Lua!
Some parts of the code are very hacky (e.g. noise) and the way new and old codes have been glued together is sometimes to be rewritten.
But at least it works.
This commit is contained in:
Gaël C
2021-06-03 23:30:04 +02:00
parent cb297af047
commit 74733549df
6 changed files with 28 additions and 18 deletions

View File

@ -110,7 +110,7 @@ end
local modpath = ""
if minetest then
if minetest.global_exists(mapgen_rivers) then
if minetest.global_exists('mapgen_rivers') then
modpath = mapgen_rivers.modpath .. "terrainlib_lua/"
else
modpath = minetest.get_modpath(minetest.get_current_modname()) .. "terrainlib_lua/"

View File

@ -29,7 +29,7 @@ local flow_methods = {
local function flow_routing(dem, dirs, lakes, method)
method = method or 'semirandom'
flow_local = flow_methods[method] or flow_local_semirandom
local flow_local = flow_methods[method] or flow_local_semirandom
dirs = dirs or {}
lakes = lakes or {}
@ -194,7 +194,7 @@ local function flow_routing(dem, dirs, lakes, method)
end
end
basin_graph = {}
local basin_graph = {}
for n=1, nbasins do
--print(n, nbasins)
local b1, lnk1 = next(lowlevel)