1
0
Fork 0

Rain now also extinguishes neighbor tiles

This commit is contained in:
Wuzzy 2020-05-09 15:59:39 +02:00
parent 0c96e512d7
commit d13498e6f9
1 changed files with 15 additions and 3 deletions

View File

@ -204,10 +204,22 @@ if mcl_weather.allow_abm then
interval = 2.0, interval = 2.0,
chance = 2, chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
-- Fire is extinguished if in rain or one of 4 neighbors is in rain
if mcl_weather.rain.raining and mcl_weather.rain.extinguish_fire then if mcl_weather.rain.raining and mcl_weather.rain.extinguish_fire then
if mcl_weather.is_outdoor(pos) then local around = {
{ x = 0, y = 0, z = 0 },
{ x = -1, y = 0, z = 0 },
{ x = 1, y = 0, z = 0 },
{ x = 0, y = 0, z = -1 },
{ x = 0, y = 0, z = 1 },
}
for a=1, #around do
local apos = vector.add(pos, around[a])
if mcl_weather.is_outdoor(apos) then
minetest.remove_node(pos) minetest.remove_node(pos)
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true) minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
return
end
end end
end end
end, end,