Skip to content

Commit

Permalink
Fix placing certain signs (#29)
Browse files Browse the repository at this point in the history
* Fix placing certain signs

This fixes #1 by removing node extensions before placing, just incase player got a hold of certain sign nodes they shouldnt have.

* fix typo

fix typo
  • Loading branch information
tenplus1 authored Jun 3, 2024
1 parent bb13ba6 commit 4309b35
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
Expand Up @@ -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]

Expand Down

0 comments on commit 4309b35

Please sign in to comment.