Utility fixes
This commit is contained in:
parent
e4d4f2e4dd
commit
ae14790b7f
3 changed files with 13 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
for i in v:gmatch "[^.]+" do
|
||||
if type(x) ~= "table" then
|
||||
return x
|
||||
end
|
||||
|
||||
for i in v:gmatch "[^.]+" do
|
||||
x = x[i]
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue