From 0cfbd3bd0ce8e3446b7cb487242eb282a54272cd Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Wed, 25 Feb 2026 04:10:35 +0100 Subject: [PATCH] Fix plan-driven unit tracking leaks and TradeShipExecution fallthrough - Delete unit IDs from `planDrivenUnitIds` in `GameImpl.removeUnit` - Return early on `PathStatus.COMPLETE`/`NOT_FOUND` in `TradeShipExecution.tick` to avoid post-delete motion-plan logic --- src/core/execution/TradeShipExecution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts index 262ba3744..9b6d932b9 100644 --- a/src/core/execution/TradeShipExecution.ts +++ b/src/core/execution/TradeShipExecution.ts @@ -124,14 +124,14 @@ export class TradeShipExecution implements Execution { break; case PathStatus.COMPLETE: this.complete(); - break; + return; case PathStatus.NOT_FOUND: console.warn("captured trade ship cannot find route"); if (this.tradeShip.isActive()) { this.tradeShip.delete(false); } this.active = false; - break; + return; } const dst = this._dstPort.tile();