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.
This commit is contained in:
tenplus1 2024-04-23 11:29:40 +01:00 committed by GitHub
parent 3d5ba32fa0
commit 6266f04bf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -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]