From ef8cf57941681a09e54202520c57b23201550ef5 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Thu, 31 Dec 2020 21:12:04 +1100 Subject: [PATCH] fix banners not being protected --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 14c6f06..02e211b 100644 --- a/init.lua +++ b/init.lua @@ -159,11 +159,12 @@ banners.banner_on_use = function(itemstack, player, pointed_thing) end banners.banner_on_dig = function(pos, node, player) + if not player or minetest.is_protected(pos, player:get_player_name()) then + return + end local meta = minetest.get_meta(pos) - if player then - local inventory = player:get_inventory() - inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")}) - end + local inventory = player:get_inventory() + inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")}) minetest.remove_node(pos) end