From 6266f04bf14368fbd4a79d20063090f6ad03ab12 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 23 Apr 2024 11:29:40 +0100 Subject: [PATCH 1/2] Fix placing certain signs This fixes https://github.com/mt-mods/signs_lib/issues/1 by removing node extensions before placing, just incase player got a hold of certain sign nodes they shouldnt have. --- api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api.lua b/api.lua index 90f635d..a5aa4a5 100644 --- a/api.lua +++ b/api.lua @@ -943,7 +943,13 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke local controls = placer:get_player_control() local signname = itemstack:get_name() + + -- incase player has sign nodes they shouldnt, remove extensions for normal sign local no_wall_name = string.gsub(signname, "_wall", "") + no_wall_name = string.gsub(no_wall_name, "_yard", "") + no_wall_name = string.gsub(no_wall_name, "_hanging", "") + no_wall_name = string.gsub(no_wall_name, "_onpole_horiz", "") + no_wall_name = string.gsub(no_wall_name, "_onpole", "") local def = minetest.registered_items[signname] From 58094c8690991bcd4724b20781f90f42a9e44d77 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 23 Apr 2024 14:53:02 +0100 Subject: [PATCH 2/2] fix typo fix typo --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index a5aa4a5..f07f0a3 100644 --- a/api.lua +++ b/api.lua @@ -944,7 +944,7 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke local signname = itemstack:get_name() - -- incase player has sign nodes they shouldnt, remove extensions for normal sign + -- in case player has sign nodes they shouldn't, remove extensions for normal sign local no_wall_name = string.gsub(signname, "_wall", "") no_wall_name = string.gsub(no_wall_name, "_yard", "") no_wall_name = string.gsub(no_wall_name, "_hanging", "")