From 7fa37d98e9c07a792d186bc638431ba34d7a0968 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Tue, 13 Feb 2024 12:01:59 -0300 Subject: [PATCH] fix gsub to sub --- init.lua | 2 +- text.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0234987..2689c5a 100644 --- a/init.lua +++ b/init.lua @@ -648,7 +648,7 @@ if airutils._use_signs_api then if entity then if entity.owner == name or minetest.check_player_privs(name, {protection_bypass=true}) then if param then - entity._ship_name = string.gsub(param, 1,20) + entity._ship_name = string.sub(param, 1,20) else entity._ship_name = "" end diff --git a/text.lua b/text.lua index 463c6b7..616f209 100644 --- a/text.lua +++ b/text.lua @@ -176,6 +176,7 @@ local function make_text_texture(text, default_color, line_width, line_height, c end function airutils.convert_text_to_texture(text, default_color, horizontal_aligment) + text = text or "" default_color = default_color or 0 horizontal_aligment = horizontal_aligment or 3 local font_size