Utility fixes

This commit is contained in:
Emik 2026-07-19 20:03:04 +02:00
parent e4d4f2e4dd
commit b485c40a7d
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
3 changed files with 13 additions and 8 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland", "id": "Roland",
"name": "Roland", "name": "Roland",
"prefix": "Roland", "prefix": "Roland",
"version": "2.9.64", "version": "2.9.65",
"badge_colour": "8BE9FD", "badge_colour": "8BE9FD",
"display_name": "Roland", "display_name": "Roland",
"main_file": "src/main.lua", "main_file": "src/main.lua",

View file

@ -135,7 +135,7 @@ end
---@return V ---@return V
---@nodiscard ---@nodiscard
local function autopairs(tbl, fpairs) 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 end
--- Always returns nil. --- Always returns nil.
@ -240,11 +240,11 @@ end
---@nodiscard ---@nodiscard
function f.indices(v) function f.indices(v)
return function(x) return function(x)
if type(x) ~= "table" then
return x
end
for i in v:gmatch "[^.]+" do for i in v:gmatch "[^.]+" do
if type(x) ~= "table" then
return x
end
x = x[i] x = x[i]
end end

View file

@ -22,7 +22,12 @@ local function add(v)
end end
if not G.P_TAGS[v] then 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 end
local tag = Tag(v) local tag = Tag(v)
@ -68,7 +73,7 @@ local function find(it)
:where(type, "table") :where(type, "table")
:where(function(v, k) :where(function(v, k)
return ((G.P_CENTERS[k] or {}).config or G.P_BLINDS[k]) and 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) end)
:keys() :keys()
:any() :any()