fix snow not being properly removed

This commit is contained in:
cora 2022-01-31 00:35:26 +01:00
parent 6220ef4205
commit 5f910e3803
2 changed files with 8 additions and 1 deletions

View File

@ -43,6 +43,7 @@ end
function mcl_weather.snow.clear() function mcl_weather.snow.clear()
mcl_weather.skycolor.remove_layer("weather-pack-snow-sky") mcl_weather.skycolor.remove_layer("weather-pack-snow-sky")
mcl_weather.snow.init_done = false mcl_weather.snow.init_done = false
mcl_weather.remove_all_spawners()
end end
-- Simple random texture getter -- Simple random texture getter
@ -69,7 +70,7 @@ minetest.register_globalstep(function(dtime)
end end
for _, player in pairs(get_connected_players()) do for _, player in pairs(get_connected_players()) do
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos()) or not mcl_weather.is_outoor(player:get_pos())) then if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos()) or not mcl_weather.is_outdoor(player:get_pos())) then
mcl_weather.remove_spawners_player(player) mcl_weather.remove_spawners_player(player)
return false return false
end end

View File

@ -70,6 +70,12 @@ function mcl_weather.remove_spawners_player(pl)
return true return true
end end
function mcl_weather.remove_all_spawners()
for k,v in pairs(minetest.get_connected_players()) do
mcl_weather.remove_spawners_player(v)
end
end
function mcl_weather.get_rand_end_time(min_duration, max_duration) function mcl_weather.get_rand_end_time(min_duration, max_duration)
local r local r
if min_duration and max_duration then if min_duration and max_duration then