mods weather: Fix error caused by missing biomes

* backported from 3425f97009
This commit is contained in:
mckaygerhard 2024-04-24 13:51:20 -04:00
parent 8c07924bf1
commit cf9778abb3

View File

@ -69,6 +69,7 @@ local function rangelim(value, lower, upper)
return math.min(math.max(value, lower), upper)
end
local is_older = minetest.has_feature("no_chat_message_prediction")
local os_time_0 = os.time()
local t_offset = math.random(0, 300000)
@ -88,7 +89,8 @@ local function update_clouds()
local n_speedz = nobj_speedz:get_2d({x = time, y = 0})
for _, player in ipairs(minetest.get_connected_players()) do
local humid = minetest.get_humidity(player:get_pos())
local humid = minetest.get_humidity(player:get_pos()) or 50
if is_older then
player:set_clouds({
density = rangelim(humid / 100, 0.25, 1.0) * n_density,
thickness = math.max(math.floor(
@ -97,6 +99,7 @@ local function update_clouds()
speed = {x = n_speedx * 4, z = n_speedz * 4},
})
end
end
end