mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:53:31 +00:00
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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user