1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2024-12-25 08:40:17 +01:00

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
This commit is contained in:
tenplus1 2024-06-03 23:10:42 +01:00 committed by GitHub
parent bb13ba6d7c
commit 4309b3575a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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()
-- 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]