1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-29 16:00:16 +01:00

generate snow only into air

This commit is contained in:
HybridDog 2015-06-17 17:51:48 +02:00
parent ccc1b5154d
commit 4a9fbc8202

View File

@ -355,9 +355,21 @@ minetest.register_on_generated(function(minp, maxp, seed)
local param2s local param2s
if num ~= 1 then if num ~= 1 then
for _,i in pairs(snow_tab) do local unwanteds,u = {},1
-- set snow for n,i in pairs(snow_tab) do
data[area:index(i[3], i[1]+1, i[2])] = c.snow local p = area:index(i[3], i[1]+1, i[2])
if data[p] == c.air then
-- set snow
data[p] = c.snow
else
unwanteds[u] = n
u = u+1
end
end
if u ~= 1 then
for _,n in pairs(unwanteds) do
snow_tab[n] = nil
end
end end
local wsz, wsx local wsz, wsx
for _,i in pairs(snow_tab) do for _,i in pairs(snow_tab) do