mirror of
https://github.com/mt-mods/signs_lib.git
synced 2024-12-25 00:30:18 +01:00
add text check for entity creation
This commit is contained in:
parent
ac8b00f826
commit
d71dcf4874
5
api.lua
5
api.lua
@ -252,7 +252,10 @@ function signs_lib.set_obj_text(pos, text)
|
||||
local text_ansi = Utf8ToAnsi(text)
|
||||
local n = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||
signs_lib.delete_objects(pos)
|
||||
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
|
||||
-- only create sign entity for actual text
|
||||
if text_ansi and text_ansi ~= "" then
|
||||
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
|
||||
end
|
||||
end
|
||||
|
||||
-- rotation
|
||||
|
Loading…
Reference in New Issue
Block a user