diff --git a/api/api.lua b/api/api.lua index 85c638b2..052c42c0 100644 --- a/api/api.lua +++ b/api/api.lua @@ -219,13 +219,15 @@ end local capture_cache = {} function pfUI.api.GetCaptures(pat) local r = capture_cache + if not r[pat] then for a, b, c, d, e in gfind(gsub(pat, "%((.+)%)", "%1"), gsub(pat, "%d%$", "%%(.-)$")) do r[pat] = { a, b, c, d, e} end + + r[pat] = r[pat] or {} end - if not r[pat] then return nil, nil, nil, nil end return r[pat][1], r[pat][2], r[pat][3], r[pat][4], r[pat][5] end