From 09ffe0ebbc2283d7d063a1934c7dc080a16861ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B7=E4=B8=AA=E5=90=8D=E5=AD=97=E5=A5=BD=E9=9A=BE?= =?UTF-8?q?=E7=9A=84=E5=96=B5?= <25520958+MisakaAldrich@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:12:30 +0800 Subject: [PATCH] fix: AutoFishing cdCal (#2748) --- repo/js/AutoFishingTeyvat/main.js | 10 +++++----- repo/js/AutoFishingTeyvat/manifest.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/repo/js/AutoFishingTeyvat/main.js b/repo/js/AutoFishingTeyvat/main.js index 635baabd4..ba99616c9 100644 --- a/repo/js/AutoFishingTeyvat/main.js +++ b/repo/js/AutoFishingTeyvat/main.js @@ -243,7 +243,7 @@ * @description * 当前采用的CD计算为基于当前冷却时间对象中的 status 属性,计算并返回三天后(从当天 0 点开始计算)的时间戳。 */ - async function cdCal(status) { + function cdCal(status, current_cd) { // 计算垂钓点再次可用的时间戳 let critical_time_date = new Date(current_cd[status]); critical_time_date.setHours(0, 0, 0, 0); @@ -750,7 +750,7 @@ if (fishing_time === "全天") { let daytime = true; if (current_cd["Daytime"] !== null) { - let critical_time = cdCal("Daytime"); + let critical_time = cdCal("Daytime", current_cd); if (now < critical_time) { log.info(`该垂钓点(白天)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`); @@ -763,7 +763,7 @@ } if (current_cd["Nighttime"] !== null) { - let critical_time = cdCal("Nighttime"); + let critical_time = cdCal("Nighttime", current_cd); if (now < critical_time) { log.info(`该垂钓点(夜晚)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`); @@ -779,7 +779,7 @@ } } else if (fishing_time === "白天") { if (current_cd["Daytime"] !== null) { - let critical_time = cdCal("Daytime"); + let critical_time = cdCal("Daytime", current_cd); if (now < critical_time) { log.info(`该垂钓点(白天)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`); @@ -791,7 +791,7 @@ } } else if (fishing_time === "夜晚") { if (current_cd["Nighttime"] !== null) { - let critical_time = cdCal("Nighttime"); + let critical_time = cdCal("Nighttime", current_cd); if (now < critical_time) { log.info(`该垂钓点(夜晚)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`); diff --git a/repo/js/AutoFishingTeyvat/manifest.json b/repo/js/AutoFishingTeyvat/manifest.json index 409598290..8b9079718 100644 --- a/repo/js/AutoFishingTeyvat/manifest.json +++ b/repo/js/AutoFishingTeyvat/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "提瓦特自动钓鱼(全流程+自选)", - "version": "2.4.0", + "version": "2.4.1", "bgi_version": "0.55.0", "description": "支持自动追踪并垂钓bgi支持的全提瓦特垂钓点", "authors": [