From 4309b3575ad806adac434819876c172583b3da04 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 3 Jun 2024 23:10:42 +0100 Subject: [PATCH] Fix placing certain signs (#29) * 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. * fix typo fix typo --- api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api.lua b/api.lua index 90f635d..f07f0a3 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() + + -- 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", "") + 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]