summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--water.lua32
1 files changed, 20 insertions, 12 deletions
diff --git a/water.lua b/water.lua
index 6a994e8..a698ebb 100644
--- a/water.lua
+++ b/water.lua
@@ -126,9 +126,11 @@ minetest.register_abm({
if ethereal.torchdrop == true then
local torch_drop = "default:torch"
+local drop_sound = "fire_extinguish_flame"
if minetest.get_modpath("real_torch") then
torch_drop = "real_torch:torch"
+ drop_sound = "real_torch_extinguish"
end
minetest.register_abm({
@@ -145,22 +147,28 @@ minetest.register_abm({
{x = pos.x - 1, y = pos.y, z = pos.z},
{x = pos.x + 1, y = pos.y, z = pos.z},
{"group:water"})
-if num == 0 then
- num = num + #minetest.find_nodes_in_area(
- {x = pos.x, y = pos.y, z = pos.z - 1},
- {x = pos.x, y = pos.y, z = pos.z + 1},
- {"group:water"})
-end
-if num == 0 then
- num = num + #minetest.find_nodes_in_area(
- {x = pos.x, y = pos.y + 1, z = pos.z},
- {x = pos.x, y = pos.y + 1, z = pos.z},
- {"group:water"})
-end
+
+ if num == 0 then
+ num = num + #minetest.find_nodes_in_area(
+ {x = pos.x, y = pos.y, z = pos.z - 1},
+ {x = pos.x, y = pos.y, z = pos.z + 1},
+ {"group:water"})
+ end
+
+ if num == 0 then
+ num = num + #minetest.find_nodes_in_area(
+ {x = pos.x, y = pos.y + 1, z = pos.z},
+ {x = pos.x, y = pos.y + 1, z = pos.z},
+ {"group:water"})
+ end
+
if num > 0 then
minetest.set_node(pos, {name = "air"})
+ minetest.sound_play({name = drop_sound, gain = 0.2},
+ {pos = pos, max_hear_distance = 10})
+
minetest.add_item(pos, {name = torch_drop})
end
end,