Skip to content

Commit

Permalink
fix a bug in how column decoration happens
Browse files Browse the repository at this point in the history
  • Loading branch information
FaceDeer committed Mar 27, 2021
1 parent 6439ca5 commit 6cc2fe8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
for vi, x, y, z in area:iterp_yxz(emin, emax) do
-- We're "over-generating" when carving out the empty space of the cave volume so that decorations
-- can slop over the boundaries of the mapblock without being cut off.
-- We only want to add vi to the various decoration node lists if we're actually whithin the mapblock.
-- We only want to add vi to the various decoration node lists if we're actually within the mapblock.
local is_within_current_mapblock = mapgen_helper.is_pos_within_box({x=x, y=y, z=z}, minp, maxp)

if y < previous_y then
Expand Down Expand Up @@ -452,7 +452,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
end

if column_value > 0 and cave_value - column_value * column_weight < cave_local_threshold then
if is_ground_content(data[vi]) then
-- only add column nodes if we're within the current mapblock because
-- otherwise we're adding column nodes that the decoration loop won't know about
if is_ground_content(data[vi]) and is_within_current_mapblock then
data[vi] = c_column -- add a column node
end
this_node_state = inside_column
Expand Down

0 comments on commit 6cc2fe8

Please sign in to comment.