diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts index 0538d42e5..2c6b80e59 100644 --- a/src/core/execution/TradeShipExecution.ts +++ b/src/core/execution/TradeShipExecution.ts @@ -110,26 +110,6 @@ export class TradeShipExecution implements Execution { const result = this.pathFinder.next(curTile, dst); switch (result.status) { - case PathStatus.PENDING: - if (dst !== this.motionPlanDst) { - this.motionPlanId++; - const from = curTile; - const path = this.pathFinder.findPath(from, dst) ?? [from]; - if (path.length === 0 || path[0] !== from) { - path.unshift(from); - } - - this.mg.recordMotionPlan({ - kind: "grid", - unitId: this.tradeShip.id(), - planId: this.motionPlanId, - startTick: ticks + 1, - ticksPerStep: 1, - path, - }); - this.motionPlanDst = dst; - } - break; case PathStatus.NEXT: if (dst !== this.motionPlanDst) { this.motionPlanId++; diff --git a/src/core/execution/TransportShipExecution.ts b/src/core/execution/TransportShipExecution.ts index 061811c34..3504e691c 100644 --- a/src/core/execution/TransportShipExecution.ts +++ b/src/core/execution/TransportShipExecution.ts @@ -248,8 +248,6 @@ export class TransportShipExecution implements Execution { case PathStatus.NEXT: this.boat.move(result.node); break; - case PathStatus.PENDING: - break; case PathStatus.NOT_FOUND: { // TODO: add to poisoned port list const map = this.mg.map(); diff --git a/src/core/execution/WarshipExecution.ts b/src/core/execution/WarshipExecution.ts index 189ad9924..70bfb654c 100644 --- a/src/core/execution/WarshipExecution.ts +++ b/src/core/execution/WarshipExecution.ts @@ -190,9 +190,6 @@ export class WarshipExecution implements Execution { case PathStatus.NEXT: this.warship.move(result.node); break; - case PathStatus.PENDING: - this.warship.touch(); - break; case PathStatus.NOT_FOUND: { console.log(`path not found to target`); break; @@ -221,9 +218,6 @@ export class WarshipExecution implements Execution { case PathStatus.NEXT: this.warship.move(result.node); break; - case PathStatus.PENDING: - this.warship.touch(); - return; case PathStatus.NOT_FOUND: { console.log(`path not found to target`); break; diff --git a/src/core/pathfinding/types.ts b/src/core/pathfinding/types.ts index 89e746957..c844b9df0 100644 --- a/src/core/pathfinding/types.ts +++ b/src/core/pathfinding/types.ts @@ -4,14 +4,12 @@ */ export enum PathStatus { - NEXT, - PENDING, - COMPLETE, - NOT_FOUND, + NEXT = 0, + COMPLETE = 2, + NOT_FOUND = 3, } export type PathResult = - | { status: PathStatus.PENDING } | { status: PathStatus.NEXT; node: T } | { status: PathStatus.COMPLETE; node: T } | { status: PathStatus.NOT_FOUND };