From 616f207e2e250a5aae30236bc72e03e7b733783e Mon Sep 17 00:00:00 2001 From: Derek Date: Tue, 31 May 2022 11:26:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/seaGold.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/seaGold.js b/scripts/seaGold.js index fd293226..66bde13c 100644 --- a/scripts/seaGold.js +++ b/scripts/seaGold.js @@ -118,6 +118,9 @@ class SeaGold { const curNode = this.getNode(this.gameInfo.curPos); const bestNode = this.getBestNode(bmmap); const path = this.getRoutePath(bmmap, curNode, bestNode); + if (!Array.isArray(path)) { + throw new Error(`路径 ${JSON.stringify(path)} 无法在地图 ${JSON.stringify(this.getMaze(bmmap))} 行进.`); + } const commands = this.getCommands(path); if (commands.length <= 0) { return false;