From 67a9eaa4d53205676bc81e2c03306e1f13d9cc30 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 22 Nov 2024 22:42:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8B=87=E5=A3=AB=E5=9C=A8=E9=AB=98?= =?UTF-8?q?=E5=80=8D=E9=80=9F=E5=BD=95=E5=83=8F=E6=92=AD=E6=94=BE=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E7=9E=AC=E7=A7=BB=E4=B8=80=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/libs/control.js | 2 +- src/core/render/preset/hero.ts | 9 ++++++--- src/game/state/move.ts | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/libs/control.js b/public/libs/control.js index 71f3422..1e3a710 100644 --- a/public/libs/control.js +++ b/public/libs/control.js @@ -2825,7 +2825,7 @@ control.prototype.checkRouteFolding = function () { if (core.status.routeFolding[v].length >= one.length) delete core.status.routeFolding[v]; }); - core.status.route = core.status.route.slice(0, one.length); + core.status.route.splice(one.length); this._bindRoutePush(); } } diff --git a/src/core/render/preset/hero.ts b/src/core/render/preset/hero.ts index 90e338b..98c65ea 100644 --- a/src/core/render/preset/hero.ts +++ b/src/core/render/preset/hero.ts @@ -111,7 +111,8 @@ export class HeroRenderer autotile: false, bigImage: true, render: this.getRenderFromDir(this.showDir), - animate: 0 + animate: 0, + alpha: 1 }; } @@ -247,6 +248,7 @@ export class HeroRenderer */ readyMove() { this.moving = true; + this.fixMoveSpeed(); } /** @@ -261,8 +263,9 @@ export class HeroRenderer } this.moveDir = dir; - if (this.moveDetached) return this.moveDetached; - else { + if (this.moveDetached) { + return this.moveDetached; + } else { this.step(); this.moveDetached = new Promise(res => { this.once('stepEnd', () => { diff --git a/src/game/state/move.ts b/src/game/state/move.ts index bc58e03..9f524e1 100644 --- a/src/game/state/move.ts +++ b/src/game/state/move.ts @@ -646,6 +646,8 @@ export class HeroMover extends ObjectMoverBase { if (x === 0) core.setHeroLoc('x', map.width - 1); else core.setHeroLoc('x', 0); } else { + // console.trace(); + core.setHeroLoc('x', nx, true); core.setHeroLoc('y', ny, true); }