From f3cef985208696c12c9e8eef042e73511ca5ddd9 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Wed, 30 Jul 2014 10:15:25 -0400 Subject: [PATCH] warn user if they're not allowed to set a fire --- fake_fire/modfiles/nodes.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fake_fire/modfiles/nodes.lua b/fake_fire/modfiles/nodes.lua index f4bcb16..315e027 100644 --- a/fake_fire/modfiles/nodes.lua +++ b/fake_fire/modfiles/nodes.lua @@ -249,12 +249,12 @@ minetest.register_tool("fake_fire:flint_and_steel", { string.find(minetest.get_node(pointed_thing.under).name, "ice") and minetest.get_node(pointed_thing.above).name == "air" - and not - minetest.is_protected(pointed_thing.above, user:get_player_name()) then - minetest.set_node(pointed_thing.above, - {name="fake_fire:smokeless_fire"}) - + if not minetest.is_protected(pointed_thing.above, user:get_player_name()) then + minetest.set_node(pointed_thing.above, {name="fake_fire:smokeless_fire"}) + else + minetest.chat_send_player(user:get_player_name(), "You can't set a fire in someone else's area!") + end elseif pointed_thing.type == "node" @@ -268,11 +268,12 @@ minetest.register_tool("fake_fire:flint_and_steel", { ) and minetest.get_node(pointed_thing.above).name == "air" - and not - minetest.is_protected(pointed_thing.above, user:get_player_name()) then - minetest.set_node(pointed_thing.above, - {name="fake_fire:smokeless_ice_fire"}) + if not minetest.is_protected(pointed_thing.above, user:get_player_name()) then + minetest.set_node(pointed_thing.above, {name="fake_fire:smokeless_ice_fire"}) + else + minetest.chat_send_player(user:get_player_name(), "You can't set a fire in someone else's area!") + end end -- Line 210, if end -- Line 207, for/do