From d1c70e904bb74f421ef448b552881cbb1a3fbfb3 Mon Sep 17 00:00:00 2001 From: Till Affeldt Date: Fri, 24 Feb 2023 08:27:23 +0100 Subject: [PATCH] make humidity timescale configurable via variable --- lib/commands.lua | 1 - lib/world.lua | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/commands.lua b/lib/commands.lua index 8189efa..934c333 100644 --- a/lib/commands.lua +++ b/lib/commands.lua @@ -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 }) \ No newline at end of file diff --git a/lib/world.lua b/lib/world.lua index 63eb027..63b99b4 100644 --- a/lib/world.lua +++ b/lib/world.lua @@ -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