Skip to content

Commit

Permalink
MapGen: biome_fill_air(): remove up-value dependency. Relates to lo…
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Jul 9, 2023
1 parent a7e3e18 commit df704c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mods/lord/lottmapgen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
if open then -- if open to sky then flora
local surf_vi = area:index(x, surfy + 1, z)

local function biome_fill_air(air, vm_data, index)
local function biome_fill_air(air, vm_area, vm_data, index)
if type(air) == "number" then
vm_data[index] = air
return true
Expand All @@ -356,7 +356,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
for tree, rarity in pairs(air.flora.trees) do
if math.random(rarity) == 1 then
if type(tree) == "function" then
tree(x, surfy + 1, z, area, vm_data)
local pos = vm_area:position(index)
tree(pos.x, pos.y, pos.z, vm_area, vm_data)
else
vm_data[index] = tree
end
Expand Down Expand Up @@ -566,7 +567,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
},
}

biome_fill_air(biome_air[biome], data, surf_vi)
biome_fill_air(biome_air[biome], area, data, surf_vi)

end
end
Expand Down

0 comments on commit df704c7

Please sign in to comment.