global climate max_height
parent
36f5cb737c
commit
48cc49b4c4
|
@ -1,5 +1,7 @@
|
|||
#Climate Min Height
|
||||
climate_min_height = -10
|
||||
#Climate Max Height (normally clouds at 120)
|
||||
climate_max_height = 120
|
||||
#Chance of the a new volume climate to be created
|
||||
##in seconds
|
||||
climate_change_ratio = 600
|
||||
|
|
31
engine.lua
31
engine.lua
|
@ -9,20 +9,21 @@ climatez.settings = {}
|
|||
|
||||
local settings = Settings(modpath .. "/climatez.conf")
|
||||
|
||||
climatez.settings.climate_min_height = tonumber(settings:get("climate_min_height"))
|
||||
climatez.settings.climate_change_ratio = tonumber(settings:get("climate_change_ratio"))
|
||||
climatez.settings.radius = tonumber(settings:get("climate_radius"))
|
||||
climatez.settings.climate_duration = tonumber(settings:get("climate_duration"))
|
||||
climatez.settings.duration_random_ratio = tonumber(settings:get("climate_duration_random_ratio"))
|
||||
climatez.settings.climate_period = tonumber(settings:get("climate_period"))
|
||||
climatez.settings.climate_rain_sound = settings:get_bool("climate_rain_sound")
|
||||
climatez.settings.thunder_sound = settings:get_bool("thunder_sound")
|
||||
climatez.settings.storm_chance = tonumber(settings:get("storm_chance"))
|
||||
climatez.settings.lightning = settings:get_bool("lightning")
|
||||
climatez.settings.lightning_chance = tonumber(settings:get("lightning_chance"))
|
||||
climatez.settings.dust_effect = settings:get_bool("dust_effect")
|
||||
|
||||
local climate_max_height = tonumber(minetest.settings:get('cloud_height', true)) or 120
|
||||
climatez.settings = {
|
||||
climate_min_height = tonumber(settings:get("climate_min_height")),
|
||||
climate_max_height = tonumber(minetest.settings:get('climate_max_height', true)) or 120,
|
||||
climate_change_ratio = tonumber(settings:get("climate_change_ratio")),
|
||||
radius = tonumber(settings:get("climate_radius")),
|
||||
climate_duration = tonumber(settings:get("climate_duration")),
|
||||
duration_random_ratio = tonumber(settings:get("climate_duration_random_ratio")),
|
||||
climate_period = tonumber(settings:get("climate_period")),
|
||||
climate_rain_sound = settings:get_bool("climate_rain_sound"),
|
||||
thunder_sound = settings:get_bool("thunder_sound"),
|
||||
storm_chance = tonumber(settings:get("storm_chance")),
|
||||
lightning = settings:get_bool("lightning"),
|
||||
lightning_chance = tonumber(settings:get("lightning_chance")),
|
||||
dust_effect = settings:get_bool("dust_effect"),
|
||||
}
|
||||
|
||||
local timer = 0 -- A timer to create climates each x seconds an for lightning too.
|
||||
|
||||
|
@ -58,7 +59,7 @@ end
|
|||
local function player_inside_climate(player_pos)
|
||||
--This function returns the climate_id if inside and true/false if the climate is enabled or not
|
||||
--check altitude
|
||||
if (player_pos.y < climatez.settings.climate_min_height) or (player_pos.y > climate_max_height) then
|
||||
if (player_pos.y < climatez.settings.climate_min_height) or (player_pos.y > climatez.settings.climate_max_height) then
|
||||
return false, nil, nil
|
||||
end
|
||||
--check if on water
|
||||
|
|
Loading…
Reference in New Issue