Fix importing actionbars

This commit is contained in:
2025-05-06 23:04:20 +02:00
parent f5b9b973e3
commit b43608b724

View File

@@ -407,6 +407,7 @@ function ParseAction(action)
if not action or action == "" then return ret end
action = strtrim(action)
---@type string, string, string
local slot, id, typeChar = string.match(action, "([^\\]+)\\([^\\]+)\\([^\\]+)")
if not typeChar then
print(string.format("Unknown action type '%s' for action '%s'", tostring(typeChar), FormatAction(ret)))
@@ -418,10 +419,8 @@ function ParseAction(action)
return ret
end
slot = tonumber(slot)
id = tonumber(id)
if not slot then
local slotNum = tonumber(slot)
if not slotNum then
print(string.format("Unknown slot '%s' for action '%s'", tostring(slot), FormatAction(ret)))
return ret
end
@@ -432,7 +431,7 @@ function ParseAction(action)
end
return {
slot = slot,
slot = slotNum,
id = id,
type = type,
}