Merge branch 'master' of https://github.com/theFox6/minetest_mod_weather
This commit is contained in:
commit
056ab5730d
|
@ -1,11 +1,7 @@
|
|||
allow_defined_top = true
|
||||
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"dump", "vector",
|
||||
"VoxelManip", "VoxelArea",
|
||||
table = { fields = { "copy" } },
|
||||
"lightning",
|
||||
}
|
||||
|
||||
ignore = {"122"}
|
||||
}
|
|
@ -62,14 +62,14 @@ function weather_mod.register_downfall(id,def)
|
|||
end
|
||||
|
||||
if minetest.get_modpath("lightning") then
|
||||
lightning.auto = false
|
||||
rawset(lightning,"auto",false)
|
||||
end
|
||||
|
||||
function weather_mod.handle_lightning()
|
||||
if not minetest.get_modpath("lightning") then return end
|
||||
local current_downfall = weather_mod.registered_downfalls[weather.type]
|
||||
if not current_downfall then return end
|
||||
lightning.auto = current_downfall.enable_lightning
|
||||
rawset(lightning,"auto",current_downfall.enable_lightning)
|
||||
if current_downfall.enable_lightning and math.random(1,2) == 1 then
|
||||
local time = math.floor(math.random(lightning.interval_low/2,lightning.interval_low))
|
||||
minetest.after(time, lightning.strike)
|
||||
|
@ -92,7 +92,7 @@ minetest.register_globalstep(function()
|
|||
if math.random(1, 10000) == 1 then
|
||||
weather.type = "none"
|
||||
if minetest.get_modpath("lightning") then
|
||||
lightning.auto = false
|
||||
rawset(lightning,"auto",false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
|
||||
assert(minetest.add_particlespawner, "I told you to run the latest GitHub!")
|
||||
|
||||
weather_mod={
|
||||
modpath=minetest.get_modpath("weather"),
|
||||
}
|
||||
rawset(_G,"weather_mod",{})
|
||||
weather_mod.modpath=minetest.get_modpath("weather")
|
||||
|
||||
weather = (function()
|
||||
local file_name = minetest.get_worldpath() .. "/weather"
|
||||
|
|
Loading…
Reference in New Issue