From d05b0872913f0a20422f4ada7db24b905d7dcb1e Mon Sep 17 00:00:00 2001 From: copcap Date: Sat, 27 Apr 2024 16:20:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=A1=E9=81=B5bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/character/xianding.js b/character/xianding.js index 2c11579d4..b0bc9d0e3 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -1890,19 +1890,17 @@ game.import("character", function () { logTarget: "player", async content(event, trigger, player) { player - .judge((card) => { + .judge(card => { const evt = get.event().getParent(get.event("eventName")).getTrigger(); - if (!evt.source.isIn() || !evt.card || typeof get.number(evt.card) !== "number") - return 0; + if (!evt.source || !evt.source.isIn() || !evt.card || typeof get.number(evt.card) !== "number") return 0; if (get.number(card) > get.number(evt.card)) return 1.5; return 0; }) - .set("judge2", (r) => r.bool) + .set("judge2", r => r.bool) .set("callback", () => { const evtx = event.getParent(); const evt = event.getParent(evtx.eventName).getTrigger(); - if (!evt.source.isIn() || !evt.card || typeof get.number(evt.card) !== "number") - return; + if (!evt.source || !evt.source.isIn() || !evt.card || typeof get.number(evt.card) !== "number") return; if (event.judgeResult.number > get.number(evt.card)) { const sha = new lib.element.VCard({ name: "sha" }), target = evt.source;