skinlist: Allow textures containing '-' characters

Fixes issue #110
Thanks to Bastrabun for the code suggestion
This commit is contained in:
SmallJoker
2024-09-28 11:10:44 +02:00
parent df62f2042d
commit 3cf80c9272
3 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@ local dbgprint = false and print or function() end
function skins.register_skin(path, filename)
-- See "textures/readme.txt" for allowed formats
local prefix, sep, identifier, extension = filename:match("^(%a+)([_.])([%w_.]+)%.(%a+)$")
local prefix, sep, identifier, extension = filename:match("^(%a+)([_.])([%w_.-]+)%.(%a+)$")
--[[
prefix: "character" or "player"
sep: "." (new) or "_" (legacy)