From e67e631c292d6e0dc15284950ff1e73706cff34c Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 23 Jul 2023 14:40:44 +0200 Subject: [PATCH] Fix luacheck usage --- .luacheckrc | 1 - font_api/fallbacks.lua | 3 +-- font_api/registry.lua | 8 ++------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 6b00304..c990d53 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -2,7 +2,6 @@ unused_args = false read_globals = { "minetest", - "string", "table", "vector", "default" diff --git a/font_api/fallbacks.lua b/font_api/fallbacks.lua index a801f7b..ebe8387 100644 --- a/font_api/fallbacks.lua +++ b/font_api/fallbacks.lua @@ -19,7 +19,6 @@ -- This is the unicode char fallback map. If a char is not present in -- font, this maps indicates which char to try to use instead next. --- luacheck: ignore return { -- Lowercase chars ['a'] = 'A', ['b'] = 'B', ['c'] = 'C', ['d'] = 'D', @@ -54,7 +53,7 @@ return { ['×'] = 'x', ['Ý'] = 'Y', -- Lower case accents - ['à'] = 'a', ['à'] = 'a', ['á'] = 'a', ['â'] = 'a', + ['à'] = 'a', ['á'] = 'a', ['â'] = 'a', ['ã'] = 'a', ['ä'] = 'a', ['å'] = 'a', ['æ'] = 'ae', ['ç'] = 'c', ['è'] = 'e', ['é'] = 'e', ['ê'] = 'e', ['ë'] = 'e', diff --git a/font_api/registry.lua b/font_api/registry.lua index b760502..b497453 100644 --- a/font_api/registry.lua +++ b/font_api/registry.lua @@ -58,13 +58,9 @@ local function get_default_font() end end - -- If failed, chose first font + -- If failed, choose the first registered font if default_font == nil then - -- luacheck: ignore 512 - for _, font in pairs(font_api.registered_fonts) do - default_font = font - break - end + default_font = next(font_api.registered_fonts) end -- Error, no font registered