Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix placing certain signs
Browse files Browse the repository at this point in the history
This fixes #1 by removing node extensions before placing, just incase player got a hold of certain sign nodes they shouldnt have.
tenplus1 authored Apr 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3d5ba32 commit 6266f04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api.lua
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit 6266f04

Please sign in to comment.