diff --git a/climatez.conf b/climatez.conf index 307c129..084af4e 100644 --- a/climatez.conf +++ b/climatez.conf @@ -2,20 +2,20 @@ climate_min_height = -10 #Chance of the a new volume climate to be created ##in seconds -climate_change_ratio = 600 +climate_change_ratio = 5 #Volume of the regional climates (sphere) climate_radius = 80 #Average time of the climate -climate_duration = 80 +climate_duration = 20 #Random deviation for the duration climate_duration_random_ratio = 0.45 #Await this min time between climates -climate_period = 600 +climate_period = 5 #Sounds climate_rain_sound = true #Storm Chance ##Chance of the rain being stormy -storm_chance = 5 +storm_chance = 1 ##Lightning Effect lightning = true lightning_chance = 300 diff --git a/engine.lua b/engine.lua index 1dac027..52a5fe4 100644 --- a/engine.lua +++ b/engine.lua @@ -270,7 +270,6 @@ local function remove_climate_player(player) --remove the player--> array_remove(climatez.players, player_name) - --climatez.players[player_name] = nil end local function create_climate(player) @@ -333,7 +332,6 @@ local function create_climate(player) center = player_pos, downfall = downfall, wind = wind, - lightning = false, } --save the player @@ -407,21 +405,19 @@ local function apply_climate(player, climate_id) --Lightning if player_downfall == "storm" and climatez.settings.lightning then - local lightning = climatez.climates[climate_id].lightning + local lightning = player:get_meta():get_int("climatez:lightning") --minetest.chat_send_all(tostring(lightning)) --minetest.chat_send_all(tonumber(timer)) if timer >= 0.5 then - if not lightning then + if lightning <= 0 then local chance = math.random(climatez.settings.lightning_chance) if chance == 1 then show_lightning(player, climate_id) - climatez.climates[climate_id].lightning = true end end end - if timer >= 0.1 and lightning then + if timer >= 0.1 and lightning > 0 then remove_lightning(player) - climatez.climates[climate_id].lightning = false end end end