mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2025-07-07 18:50:36 +02:00
Tweak Fire Protect
This change tweaks the fire protection function so that it no longer needs to override nodes and hence rely on additional dependencies like ethereal mod.
This commit is contained in:
@ -477,21 +477,6 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Fire Protection, added by TenPlus1.
|
|
||||||
if armor.config.fire_protect == true then
|
|
||||||
-- override any hot nodes that do not already deal damage
|
|
||||||
for _, row in pairs(armor.fire_nodes) do
|
|
||||||
if minetest.registered_nodes[row[1]] then
|
|
||||||
local damage = minetest.registered_nodes[row[1]].damage_per_second
|
|
||||||
if not damage or damage == 0 then
|
|
||||||
minetest.override_item(row[1], {damage_per_second = row[3]})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print ("[3d_armor] Fire Nodes disabled")
|
|
||||||
end
|
|
||||||
|
|
||||||
if armor.config.fire_protect == true then
|
if armor.config.fire_protect == true then
|
||||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
|
|
||||||
@ -501,9 +486,7 @@ if armor.config.fire_protect == true then
|
|||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
for _,igniter in pairs(armor.fire_nodes) do
|
for _,igniter in pairs(armor.fire_nodes) do
|
||||||
if reason.node == igniter[1] then
|
if reason.node == igniter[1] then
|
||||||
if armor.def[name].fire < igniter[2] then
|
if armor.def[name].fire >= igniter[2] then
|
||||||
armor:punch(player, "fire")
|
|
||||||
else
|
|
||||||
hp_change = 0
|
hp_change = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user