forked from mtcontrib/minetest-mod-snow
use pos.x and pos.z directly (falling snow)
This commit is contained in:
parent
b1badd332b
commit
6bbc4d359e
@ -88,15 +88,13 @@ local get_snow = function(pos)
|
|||||||
--Legacy support.
|
--Legacy support.
|
||||||
if weather_legacy == "snow" then
|
if weather_legacy == "snow" then
|
||||||
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
|
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
|
||||||
local x = pos.x
|
if perlin1:get2d({x=pos.x, y=pos.z}) <= 0.53 then
|
||||||
local y = pos.z
|
|
||||||
if perlin1:get2d({x=x, y=y}) <= 0.53 then
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- disable falling snow in desert
|
-- disable falling snow in desert
|
||||||
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
|
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
|
||||||
local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
|
local noise3 = desert_perlin:get2d({x=pos.x+150,y=pos.z+50}) -- Offsets must match minetest mapgen desert perlin.
|
||||||
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
|
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user