mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-27 22:05:52 +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;
|
break;
|
||||||
case PathStatus.COMPLETE:
|
case PathStatus.COMPLETE:
|
||||||
this.complete();
|
this.complete();
|
||||||
break;
|
return;
|
||||||
case PathStatus.NOT_FOUND:
|
case PathStatus.NOT_FOUND:
|
||||||
console.warn("captured trade ship cannot find route");
|
console.warn("captured trade ship cannot find route");
|
||||||
if (this.tradeShip.isActive()) {
|
if (this.tradeShip.isActive()) {
|
||||||
this.tradeShip.delete(false);
|
this.tradeShip.delete(false);
|
||||||
}
|
}
|
||||||
this.active = false;
|
this.active = false;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dst = this._dstPort.tile();
|
const dst = this._dstPort.tile();
|
||||||
|
|||||||
Reference in New Issue
Block a user