From 493f74d63fbc4c92290761ae3180df74142820f2 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 27 Aug 2021 14:19:39 +0100 Subject: [PATCH] out of bounds check for placement tool --- tool.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tool.lua b/tool.lua index 14570a6..3f6709d 100644 --- a/tool.lua +++ b/tool.lua @@ -78,6 +78,11 @@ minetest.register_craftitem("protector:tool", { return end + -- do not place protector out of map bounds + if minetest.find_node_near(pos, 1, {"ignore"}) then + return + end + -- do we have protectors to use ? local nod local inv = user:get_inventory()