Load marker texture by actual addon folder name (case-proof)

This commit is contained in:
DuvelCorp
2026-09-15 07:34:39 +02:00
parent 99e7eaa5d2
commit 315f6bb4f1
2 changed files with 18 additions and 1 deletions
+17
View File
@@ -1,6 +1,23 @@
MTH_CONST = MTH_CONST or {}
MTH_CONST.version = MTH_CONST.version or "2.0.0"
-- Our AddOns folder name as actually installed. Forgejo/Codeberg zip downloads
-- force the archive's root folder to lowercase (forgejo bug #800), so resolve
-- the real casing here and build texture paths from it.
MTH_CONST.addonFolder = MTH_CONST.addonFolder or "MetaHunt"
if type(GetNumAddOns) == "function" and type(GetAddOnInfo) == "function" then
local i = 1
local total = GetNumAddOns() or 0
while i <= total do
local folder = GetAddOnInfo(i)
if type(folder) == "string" and string.lower(folder) == "metahunt" then
MTH_CONST.addonFolder = folder
break
end
i = i + 1
end
end
MTH_CONST.WEAPON_TYPES = {
BOWS = "Bows",
CROSSBOWS = "Crossbows",