diff --git a/manifest.json b/manifest.json index 02057c3..a9ba7a1 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "Roland", "name": "Roland", "prefix": "Roland", - "version": "2.9.64", + "version": "2.9.65", "badge_colour": "8BE9FD", "display_name": "Roland", "main_file": "src/main.lua", diff --git a/src/lib/funky.lua b/src/lib/funky.lua index f6f2bd9..9515d74 100644 --- a/src/lib/funky.lua +++ b/src/lib/funky.lua @@ -135,7 +135,7 @@ end ---@return V ---@nodiscard local function autopairs(tbl, fpairs) - return (fpairs or (tbl[#tbl] and ipairs or pairs))(tbl) + return (fpairs or (tbl[1] and ipairs or pairs))(tbl) end --- Always returns nil. @@ -240,11 +240,11 @@ end ---@nodiscard function f.indices(v) return function(x) - if type(x) ~= "table" then - return x - end - for i in v:gmatch "[^.]+" do + if type(x) ~= "table" then + return x + end + x = x[i] end diff --git a/src/lib/shared.lua b/src/lib/shared.lua index 7f02eca..6b9678c 100644 --- a/src/lib/shared.lua +++ b/src/lib/shared.lua @@ -22,7 +22,12 @@ local function add(v) end if not G.P_TAGS[v] then - return SMODS.add_card {no_edition = true, key = v} + return SMODS.add_card { + no_edition = true, + key = v, + area = (G.P_CENTERS[v] or {}).set == "Booster" and G.shop_booster or + (G.P_CENTERS[v] or {}).set == "Voucher" and G.shop_vouchers or nil, + } end local tag = Tag(v) @@ -68,7 +73,7 @@ local function find(it) :where(type, "table") :where(function(v, k) return ((G.P_CENTERS[k] or {}).config or G.P_BLINDS[k]) and - match == simplify(k) or match == simplify(v.name) + (match == simplify(k) or match == simplify(v.name)) end) :keys() :any()