1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2025-01-01 09:00:18 +01:00

Workaround for plantlife bug.

This commit is contained in:
Splizard 2014-06-05 15:49:24 +12:00
parent 848f30543d
commit 1cc2c6758b

View File

@ -121,6 +121,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end]] end]]
local write_to_map = false
--Loop through chunk. --Loop through chunk.
for x = minp.x, maxp.x do for x = minp.x, maxp.x do
for z = minp.z, maxp.z do for z = minp.z, maxp.z do
@ -135,6 +137,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
if in_biome then if in_biome then
write_to_map = true
local perlin2 = env:get_perlin(322345,3, 0.5, 80) local perlin2 = env:get_perlin(322345,3, 0.5, 80)
local icetype = perlin2:get2d({x=x, y=z}) local icetype = perlin2:get2d({x=x, y=z})
@ -259,6 +262,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
if write_to_map then
vm:set_data(data) vm:set_data(data)
vm:calc_lighting( vm:calc_lighting(
@ -267,6 +271,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
) )
vm:write_to_map(data) vm:write_to_map(data)
vm:update_map()
if debug then if debug then
@ -274,5 +279,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
print(biome_string.." and "..biome2_string..": Snow Biome Genarated near x"..minp.x.." z"..minp.z) print(biome_string.." and "..biome2_string..": Snow Biome Genarated near x"..minp.x.." z"..minp.z)
print(string.format("elapsed time: %.2fms", (os.clock() - t1) * 1000)) print(string.format("elapsed time: %.2fms", (os.clock() - t1) * 1000))
end end
end
--end --end
end) end)