From 073011753ad91a6933e5e66b2c9e5874e2d36246 Mon Sep 17 00:00:00 2001 From: kuangshen04 <2832899707@qq.com> Date: Mon, 4 Mar 2024 14:07:26 +0800 Subject: [PATCH] bugfix --- noname/game/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index 277c08657..b02d70580 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -5875,15 +5875,16 @@ export class Game extends Uninstantable { const useCache = !lib.config.compatiblemode && !event.skill && ['button', 'card', 'target'].every(type => { if (!event[`filter${uppercaseType(type)}`]) return true; - if (typeof event[`select${uppercaseType(type)}`] === 'function') return false; + // if (typeof event[`select${uppercaseType(type)}`] === 'function') return false; if (get.select(event[`select${uppercaseType(type)}`])[1] < 0) return false; + if (type === "button") type = "select"; return !event[`complex${uppercaseType(type)}`]; }); ['button', 'card', 'target'].forEach(type => { if (!event[`filter${uppercaseType(type)}`]) return; - if (!ok) game.uncheck(type, useCache); - else ({ ok, auto = auto } = game.Check[type](event)); + if (!ok) game.uncheck(type); + else ({ ok, auto = auto } = game.Check[type](event, useCache)); }); game.Check.skill(event); @@ -5954,9 +5955,9 @@ export class Game extends Uninstantable { if (!event[`_${type}Choice`]) event[`_${type}Choice`] = {}; const cacheId = Object.keys(ui.selected).reduce((result, Type) => { if (Type === type + 's') return result; - Type = Type.slice(0, -1); - if (Type === "target") Type = "player"; - return ui.selected[i].reduce((t, i) => t ^= i[`${Type}id`], result); + let idType = Type.slice(0, -1); + if (idType === "target") idType = "player"; + return ui.selected[Type].reduce((t, i) => t ^= i[`${idType}id`], result); }, 0); if (!event[`_${type}Choice`][cacheId]) { event[`_${type}Choice`][cacheId] = [];