From d71dcf48740406ad665e8caadd16cc9fbdce6ea3 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 19 Feb 2021 09:33:14 +0000 Subject: [PATCH] add text check for entity creation --- api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 9472dac..d2a06e2 100644 --- a/api.lua +++ b/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