Fix typo, cleanup warnings/hints

This commit is contained in:
teknomunk 2025-01-01 11:44:16 -06:00
parent 0af958fd9b
commit 96064f902e

@ -11,12 +11,10 @@ local has_mcl_portals = minetest.get_modpath("mcl_portals")
local set_node = minetest.set_node
local get_node = minetest.get_node
local add_node = minetest.add_node
local remove_node = minetest.remove_node
local swap_node = minetest.swap_node
local get_node_or_nil = minetest.get_node_or_nil
local find_nodes_in_area = minetest.find_nodes_in_area
local find_node_near = minetest.find_node_near
local get_item_group = minetest.get_item_group
local get_connected_players = minetest.get_connected_players
@ -42,7 +40,7 @@ end
shuffle_table(adjacents)
local function has_flammable(pos)
for k,v in pairs(adjacents) do
for _,v in pairs(adjacents) do
local p=vector.add(pos,v)
local n=get_node_or_nil(p)
if n and get_item_group(n.name, "flammable") ~= 0 then
@ -75,7 +73,7 @@ local function get_adjacent_fire_age(orig_pos)
pos.y = orig_pos.y + 1
lowest_age = min_neighbor_fire_age(lowest_age, pos)
pos.y, pos.z = orig_pos.y, orig_pox.z - 1
pos.y, pos.z = orig_pos.y, orig_pos.z - 1
lowest_age = min_neighbor_fire_age(lowest_age, pos)
pos.z = orig_pos.z + 1
@ -183,7 +181,7 @@ minetest.register_node("mcl_fire:fire", {
damage_per_second = 1,
groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston=1, destroys_items=1, set_on_fire=8},
floodable = true,
on_flood = function(pos, oldnode, newnode)
on_flood = function(pos, _, newnode)
if get_item_group(newnode.name, "water") ~= 0 then
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
end
@ -236,7 +234,7 @@ minetest.register_node("mcl_fire:eternal_fire", {
damage_per_second = 1,
groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston = 1, destroys_items = 1, set_on_fire=8},
floodable = true,
on_flood = function(pos, oldnode, newnode)
on_flood = function(pos, _, newnode)
if get_item_group(newnode.name, "water") ~= 0 then
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
end
@ -372,7 +370,7 @@ end
local function check_aircube(p1,p2)
local nds=minetest.find_nodes_in_area(p1,p2,{"air"})
shuffle_table(nds)
for k,v in pairs(nds) do
for _,v in pairs(nds) do
if has_flammable(v) then return v end
end
end
@ -399,7 +397,7 @@ minetest.register_abm({
interval = 3,
chance = 1,
catch_up = false,
action = function(pos, node, active_object_count, active_object_count_wider)
action = function(pos)
minetest.remove_node(pos)
minetest.sound_play("fire_extinguish_flame",
{pos = pos, max_hear_distance = 16, gain = 0.15}, true)
@ -560,7 +558,7 @@ minetest.register_lbm({
name = "mcl_fire:smoke",
nodenames = {"group:fire"},
run_at_every_load = true,
action = function(pos, node)
action = function(pos)
mcl_particles.spawn_smoke(pos, "fire", smoke_pdef)
end,
})