From 9524ff67a320dfebf9bb551e67711b922ee37963 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 11 Jul 2016 15:11:57 +0200 Subject: [PATCH] Clean up fire ABM parameters. --- mods/fire/init.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/mods/fire/init.lua b/mods/fire/init.lua index 90e2f0a8..34613da5 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -226,10 +226,10 @@ minetest.register_abm({ interval = 3, chance = 1, catch_up = false, - action = function(p0, node, _, _) - minetest.remove_node(p0) + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.remove_node(pos) minetest.sound_play("fire_extinguish_flame", - {pos = p0, max_hear_distance = 16, gain = 0.25}) + {pos = pos, max_hear_distance = 16, gain = 0.25}) end, }) @@ -245,9 +245,7 @@ if minetest.setting_getbool("disable_fire") then interval = 7, chance = 1, catch_up = false, - action = function(p0, node, _, _) - minetest.remove_node(p0) - end, + action = minetest.remove_node, }) else @@ -260,12 +258,12 @@ else interval = 7, chance = 12, catch_up = false, - action = function(p0, node, _, _) + action = function(pos, node, active_object_count, active_object_count_wider) -- If there is water or stuff like that around node, don't ignite - if minetest.find_node_near(p0, 1, {"group:puts_out_fire"}) then + if minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then return end - local p = minetest.find_node_near(p0, 1, {"air"}) + local p = minetest.find_node_near(pos, 1, {"air"}) if p then minetest.set_node(p, {name = "fire:basic_flame"}) end @@ -280,8 +278,8 @@ else interval = 5, chance = 18, catch_up = false, - action = function(p0, node, _, _) - local p = minetest.find_node_near(p0, 1, {"group:flammable"}) + action = function(pos, node, active_object_count, active_object_count_wider) + local p = minetest.find_node_near(pos, 1, {"group:flammable"}) if p then -- remove flammable nodes around flame local flammable_node = minetest.get_node(p) @@ -309,13 +307,13 @@ minetest.register_abm({ neighbors = {"air"}, interval = 5, chance = 10, - action = function(p0, node, _, _) + action = function(pos, node, active_object_count, active_object_count_wider) local reg = minetest.registered_nodes[node.name] if not reg or not reg.groups.igniter or reg.groups.igniter < 2 then return end local d = reg.groups.igniter - local p = minetest.find_node_near(p0, d, {"group:flammable"}) + local p = minetest.find_node_near(pos, d, {"group:flammable"}) if p then -- If there is water or stuff like that around flame, don't ignite if fire.flame_should_extinguish(p) then