Skip to content

Commit

Permalink
fix falling snow
Browse files Browse the repository at this point in the history
  • Loading branch information
melzua authored and HybridDog committed May 4, 2015
1 parent c050096 commit aa687f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/falling_snow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ local get_snow = function(pos)
--Legacy support.
if weather_legacy == "snow" then
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
if perlin1:get2d({x=pos.x, y=pos.z}) <= 0.53 then
local x = pos.x
local y = pos.z
if perlin1:get2d({x, y}) <= 0.53 then
return false
end

-- disable falling snow in desert
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
local noise3 = desert_perlin:get2d({x=x+150,y=z+50}) -- Offsets must match minetest mapgen desert perlin.
local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
return false
end
Expand Down

0 comments on commit aa687f5

Please sign in to comment.