Adjust cloud generation.

This commit is contained in:
Duane 2016-06-12 00:02:56 -05:00
parent 30d5f9ce96
commit 03f29b1cd8

View file

@ -47,17 +47,16 @@ fun_caves.cloudgen = function(minp, maxp, data, p2data, area, node)
end end
cloud_1[index] = floor(cloud_1[index] + 0.5) cloud_1[index] = floor(cloud_1[index] + 0.5)
if cloud_1[index] > 0 then
for y = minp.y, maxp.y do for y = minp.y, maxp.y do
local dy = y - minp.y local dy = y - minp.y
if dy > 32 and cloud_1[index] > 15 and dy < 47 then if dy > 32 and cloud_1[index] > 15 and dy < 47 then
if dy < 47 - (cloud_1[index] - 15) then if dy < 48 - (cloud_1[index] - 15) then
data[ivm] = node['fun_caves:'..cloud] data[ivm] = node['fun_caves:'..cloud]
else else
data[ivm] = node['default:water_source'] data[ivm] = node['default:water_source']
write = true write = true
end end
elseif (dy <= 32 or cloud_1[index] <= 15) and dy >= 32 - cloud_1[index] and dy <= 32 + cloud_1[index] then elseif cloud_1[index] > 0 and (dy <= 32 or cloud_1[index] <= 15) and dy >= 32 - cloud_1[index] and dy <= 32 + cloud_1[index] then
data[ivm] = node['fun_caves:'..cloud] data[ivm] = node['fun_caves:'..cloud]
write = true write = true
elseif data[ivm - area.ystride] == node['fun_caves:'..cloud] and data[ivm] == node['air'] then elseif data[ivm - area.ystride] == node['fun_caves:'..cloud] and data[ivm] == node['air'] then
@ -81,7 +80,6 @@ fun_caves.cloudgen = function(minp, maxp, data, p2data, area, node)
end end
end end
end end
end
local index = 0 local index = 0
local index3d = 0 local index3d = 0