1
0
mirror of https://gitlab.com/rautars/weather_pack.git synced 2025-07-22 08:10:22 +02:00

rainy weather now extinguish fire (if fire directly under sky)

This commit is contained in:
Arturas Norkus
2016-05-14 23:15:20 +03:00
parent f1011e800f
commit e230ba82c3
2 changed files with 45 additions and 3 deletions

View File

@ -24,7 +24,10 @@ weather = {
reg_weathers = {},
-- automaticly calculates intervals and swap weathers
auto_mode = true
auto_mode = true,
-- global flag to disable/enable ABM logic.
allow_abm = true,
}
weather.get_rand_end_time = function(min_duration, max_duration)
@ -35,6 +38,13 @@ weather.get_rand_end_time = function(min_duration, max_duration)
end
end
weather.is_outdoor = function(pos)
if minetest.get_node_light({x=pos.x, y=pos.y + 1, z=pos.z}, 0.5) == 15 then
return true
end
return false
end
-- checks if player is undewater. This is needed in order to
-- turn off weather particles generation.
function is_underwater(player)
@ -152,6 +162,13 @@ minetest.register_chatcommand("set_weather", {
end
})
-- Configuration setting which allows user to disable ABM for weathers (if they use it).
-- Weather mods expected to be use this flag before registering ABM.
local weather_allow_abm = minetest.setting_getbool("weather_allow_abm")
if weather_allow_abm ~= nil and weather_allow_abm == false then
weather.allow_abm = false
end
-- Overrides nodes 'sunlight_propagates' attribute for efficient indoor check (e.g. for glass roof).
-- Controlled from minetest.conf setting and by default it is disabled.
-- To enable set weather_allow_override_nodes to true.