diff --git a/mods/ENVIRONMENT/mcl_weather/init.lua b/mods/ENVIRONMENT/mcl_weather/init.lua index 8041570e..b362647c 100644 --- a/mods/ENVIRONMENT/mcl_weather/init.lua +++ b/mods/ENVIRONMENT/mcl_weather/init.lua @@ -232,8 +232,10 @@ function mcl_weather.tick() local cdef=mcl_weather.get_weatherdef(mcl_weather.current) if cdef.at_pos ~= nil then --switch to defined weather in at_pos conditions - if not cdef.at_pos(pos) and cdef.change_at_pos ~= nil then - mcl_weather.change_player(name,cdef.change_at_pos) + if not cdef.at_pos(pos) and cdef.change_at_pos ~= nil and cdef.change_at_pos(pos) then + mcl_weather.change_player(name,cdef.change_at_pos(pos)) + elseif not cdef.at_pos(pos) then + mcl_weather.stop_weather_player(name,cdef) else mcl_weather.change_player(name,mcl_weather.current) end diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 90448df3..c40b69ef 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -94,7 +94,12 @@ mcl_weather.register_weather("rain",{ return true end end, - change_at_pos = "snow" + change_at_pos = function(pos) + local biome=minetest.get_biome_data(pos) + if mcl_worlds.has_weather(pos) and biome.heat < 15 then + return "snow" + end + end }) if mcl_weather.allow_abm then diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index 78256596..a555c579 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -57,18 +57,13 @@ mcl_weather.register_weather("snow",{ } }, start = function() end, - start_player = function(name) - local player=minetest.get_player_by_name(name) - if not mcl_weather.snow.at_pos(player:get_pos()) then - return true - end - end, + start_player = function(name)end, clear = function() end, - at_pos = function(pos) - local biome=minetest.get_biome_data(pos) - if mcl_worlds.has_weather(pos) and biome.heat < 15 then - return true + at_pos = function(pos) end, + change_at_pos = function(pos) + local biome=minetest.get_biome_data(pos) + if pos.y > 50 or (mcl_worlds.has_weather(pos) and biome.heat > 15 ) then + return "rain" end - end, - change_at_pos = "rain" + end }) \ No newline at end of file