diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index b3d92e5d..b43622e1 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -221,6 +221,11 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate newX = direction > 0 ? Math.min(newX, stopAtX) : Math.max(newX, stopAtX); } newX = this.clampXByAllies(view.ent, model.fac, move.baseY, currentX, newX, direction); + if (direction > 0) { + newX = Math.max(currentX, newX); + } else { + newX = Math.min(currentX, newX); + } if (Math.abs(newX - currentX) < 0.01) { view.status_change("idle"); return;