Skip to content

Commit 9524ff6

Browse files
t4imparamat
authored andcommittedJul 15, 2016
Clean up fire ABM parameters.
1 parent 30b0a15 commit 9524ff6

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed
 

Diff for: ‎mods/fire/init.lua

+11-13
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ minetest.register_abm({
226226
interval = 3,
227227
chance = 1,
228228
catch_up = false,
229-
action = function(p0, node, _, _)
230-
minetest.remove_node(p0)
229+
action = function(pos, node, active_object_count, active_object_count_wider)
230+
minetest.remove_node(pos)
231231
minetest.sound_play("fire_extinguish_flame",
232-
{pos = p0, max_hear_distance = 16, gain = 0.25})
232+
{pos = pos, max_hear_distance = 16, gain = 0.25})
233233
end,
234234
})
235235

@@ -245,9 +245,7 @@ if minetest.setting_getbool("disable_fire") then
245245
interval = 7,
246246
chance = 1,
247247
catch_up = false,
248-
action = function(p0, node, _, _)
249-
minetest.remove_node(p0)
250-
end,
248+
action = minetest.remove_node,
251249
})
252250

253251
else
@@ -260,12 +258,12 @@ else
260258
interval = 7,
261259
chance = 12,
262260
catch_up = false,
263-
action = function(p0, node, _, _)
261+
action = function(pos, node, active_object_count, active_object_count_wider)
264262
-- If there is water or stuff like that around node, don't ignite
265-
if minetest.find_node_near(p0, 1, {"group:puts_out_fire"}) then
263+
if minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then
266264
return
267265
end
268-
local p = minetest.find_node_near(p0, 1, {"air"})
266+
local p = minetest.find_node_near(pos, 1, {"air"})
269267
if p then
270268
minetest.set_node(p, {name = "fire:basic_flame"})
271269
end
@@ -280,8 +278,8 @@ else
280278
interval = 5,
281279
chance = 18,
282280
catch_up = false,
283-
action = function(p0, node, _, _)
284-
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
281+
action = function(pos, node, active_object_count, active_object_count_wider)
282+
local p = minetest.find_node_near(pos, 1, {"group:flammable"})
285283
if p then
286284
-- remove flammable nodes around flame
287285
local flammable_node = minetest.get_node(p)
@@ -309,13 +307,13 @@ minetest.register_abm({
309307
neighbors = {"air"},
310308
interval = 5,
311309
chance = 10,
312-
action = function(p0, node, _, _)
310+
action = function(pos, node, active_object_count, active_object_count_wider)
313311
local reg = minetest.registered_nodes[node.name]
314312
if not reg or not reg.groups.igniter or reg.groups.igniter < 2 then
315313
return
316314
end
317315
local d = reg.groups.igniter
318-
local p = minetest.find_node_near(p0, d, {"group:flammable"})
316+
local p = minetest.find_node_near(pos, d, {"group:flammable"})
319317
if p then
320318
-- If there is water or stuff like that around flame, don't ignite
321319
if fire.flame_should_extinguish(p) then

0 commit comments

Comments
 (0)
Please sign in to comment.