Fix the possibility to put fire in a protected area (#3129)

This commit is contained in:
Andrii Nemchenko 2024-06-22 13:54:57 +03:00 committed by GitHub
parent 91f6e5faec
commit f03c992864
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -101,13 +101,18 @@ minetest.register_tool("fire:flint_and_steel", {
return return
end end
if minetest.is_protected(pointed_thing.under, player_name) then if minetest.is_protected(pointed_thing.under, player_name) then
minetest.chat_send_player(player_name, "This area is protected") minetest.record_protection_violation(pointed_thing.under, player_name)
return return
end end
if nodedef.on_ignite then if nodedef.on_ignite then
nodedef.on_ignite(pointed_thing.under, user) nodedef.on_ignite(pointed_thing.under, user)
elseif minetest.get_item_group(node_under, "flammable") >= 1 elseif minetest.get_item_group(node_under, "flammable") >= 1
and minetest.get_node(pointed_thing.above).name == "air" then and minetest.get_node(pointed_thing.above).name == "air" then
if minetest.is_protected(pointed_thing.above, player_name) then
minetest.record_protection_violation(pointed_thing.above, player_name)
return
end
minetest.set_node(pointed_thing.above, {name = "fire:basic_flame"}) minetest.set_node(pointed_thing.above, {name = "fire:basic_flame"})
end end
end end