make humidity timescale configurable via variable

This commit is contained in:
Till Affeldt 2023-02-24 08:27:23 +01:00
parent 7d299edb5b
commit d1c70e904b
2 changed files with 2 additions and 4 deletions

View File

@ -242,6 +242,5 @@ minetest.register_chatcommand("explain_humidity", {
minetest.chat_send_player(playername, dump2(base, "base"))
minetest.chat_send_player(playername, dump2(biome, "biome"))
minetest.chat_send_player(playername, dump2(random, "random"))
minetest.chat_send_player(playername, dump2(random_base, "random_base"))
end
})

View File

@ -7,8 +7,7 @@ local HEAT_SPREAD = 400
local HEAT_SCALE = 0.3
local HUMIDITY_SPREAD = 150
local HUMIDITY_SCALE = 1
local HUMIDITY_BASE_SPREAD = 800
local HUMIDITY_BASE_SCALE = 20
local HUMIDITY_TIMESCALE = 1
local nobj_wind_x
local nobj_wind_z
@ -74,7 +73,7 @@ end
local function update_humidity(timer)
nobj_humidity = nobj_humidity or minetest.get_perlin(pn_humidity)
local n_humidity = nobj_humidity:get_2d({x = timer * 3, y = 0})
local n_humidity = nobj_humidity:get_2d({x = timer * HUMIDITY_TIMESCALE, y = 0})
climate_mod.state:set_float("humidity_random", n_humidity)
end