mods weather: Fix error caused by missing biomes
* backported from 3425f97009
This commit is contained in:
parent
8c07924bf1
commit
cf9778abb3
@ -69,6 +69,7 @@ local function rangelim(value, lower, upper)
|
|||||||
return math.min(math.max(value, lower), upper)
|
return math.min(math.max(value, lower), upper)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local is_older = minetest.has_feature("no_chat_message_prediction")
|
||||||
local os_time_0 = os.time()
|
local os_time_0 = os.time()
|
||||||
local t_offset = math.random(0, 300000)
|
local t_offset = math.random(0, 300000)
|
||||||
|
|
||||||
@ -88,14 +89,16 @@ local function update_clouds()
|
|||||||
local n_speedz = nobj_speedz:get_2d({x = time, y = 0})
|
local n_speedz = nobj_speedz:get_2d({x = time, y = 0})
|
||||||
|
|
||||||
for _, player in ipairs(minetest.get_connected_players()) do
|
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
|
||||||
player:set_clouds({
|
if is_older then
|
||||||
density = rangelim(humid / 100, 0.25, 1.0) * n_density,
|
player:set_clouds({
|
||||||
thickness = math.max(math.floor(
|
density = rangelim(humid / 100, 0.25, 1.0) * n_density,
|
||||||
rangelim(32 * humid / 100, 8, 32) * n_thickness
|
thickness = math.max(math.floor(
|
||||||
), 1),
|
rangelim(32 * humid / 100, 8, 32) * n_thickness
|
||||||
speed = {x = n_speedx * 4, z = n_speedz * 4},
|
), 1),
|
||||||
})
|
speed = {x = n_speedx * 4, z = n_speedz * 4},
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user