diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index 8ca2331b..ae917fbb 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -198,8 +198,8 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const [minRange, maxRange] = this.resolveCombatRange(model, defaultMin, defaultMax); const dist = Math.abs(currentX - enemyX); const needMoveToFormation = Math.abs(currentX - targetX) > 5; - const shouldKeepDistance = dist < minRange; - if (needMoveToFormation || shouldKeepDistance) { + + if (dist >= minRange && needMoveToFormation) { const dir = targetX > currentX ? 1 : -1; move.direction = dir; const speed = model.speed / 3;