Skip to content

Commit 547a7b3

Browse files
committedAug 4, 2015
Default/functions: Reduce lavacooling ABM/sound overload
1 parent 8d1eef0 commit 547a7b3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎mods/default/functions.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,21 @@ end
9090

9191
default.cool_lava_source = function(pos)
9292
minetest.set_node(pos, {name = "default:obsidian"})
93-
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
93+
minetest.sound_play("default_cool_lava",
94+
{pos = pos, max_hear_distance = 16, gain = 0.25})
9495
end
9596

9697
default.cool_lava_flowing = function(pos)
9798
minetest.set_node(pos, {name = "default:stone"})
98-
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
99+
minetest.sound_play("default_cool_lava",
100+
{pos = pos, max_hear_distance = 16, gain = 0.25})
99101
end
100102

101103
minetest.register_abm({
102104
nodenames = {"default:lava_flowing"},
103105
neighbors = {"group:water"},
104106
interval = 1,
105-
chance = 1,
107+
chance = 2,
106108
action = function(...)
107109
default.cool_lava_flowing(...)
108110
end,
@@ -112,7 +114,7 @@ minetest.register_abm({
112114
nodenames = {"default:lava_source"},
113115
neighbors = {"group:water"},
114116
interval = 1,
115-
chance = 1,
117+
chance = 2,
116118
action = function(...)
117119
default.cool_lava_source(...)
118120
end,

0 commit comments

Comments
 (0)
Please sign in to comment.