aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-03-20 20:43:25 +0100
committerY. Wang <yw05@forksworld.de>2022-03-20 20:43:25 +0100
commit450f7b77ed5d19e61964ed6117b57fbe0a647241 (patch)
tree6e7d8b939fbeb6540bc3c3394e65a32430c05a3c
parent0cb77c1eebbb26ca2cf9dcde27158c2e59ab1b02 (diff)
downloadadvtrains-450f7b77ed5d19e61964ed6117b57fbe0a647241.tar.gz
advtrains-450f7b77ed5d19e61964ed6117b57fbe0a647241.tar.bz2
advtrains-450f7b77ed5d19e61964ed6117b57fbe0a647241.zip
Add workarounds to not break MT 5.3.0 compattrainhud-unifont
-rw-r--r--advtrains/unifont.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/advtrains/unifont.lua b/advtrains/unifont.lua
index f8c4d10..18d0ed5 100644
--- a/advtrains/unifont.lua
+++ b/advtrains/unifont.lua
@@ -21,8 +21,11 @@ local sbyte, schar, sformat, smatch, ssub = string.byte, string.char, string.for
local tconcat = table.concat
local texture_dir = tconcat({advtrains.modpath, "textures", "unifont"}, DIR_DELIM)
-minetest.rmdir(texture_dir, true)
minetest.mkdir(texture_dir)
+for _, i in pairs(minetest.get_dir_list(texture_dir)) do
+ -- FIXME: remove this workaround eventually when MT 5.5.0 becomes common
+ os.remove(texture_dir .. DIR_DELIM .. i)
+end
local function texture_file(cp)
return sformat(cp < 65536 and "%s_%04x.bmp" or "%s_%06x.bmp", "advtrains_unifont", cp)
@@ -94,7 +97,7 @@ local function cpwidth(cp)
local path = texture_path(cp)
minetest.safe_file_write(path, tconcat(bytes))
if mods_loaded then
- minetest.dynamic_add_media({filepath = path})
+ minetest.dynamic_add_media(path)
end
return width
end