From 9e95a0077be67da9682be892e120071856c8eeee Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 28 May 2025 13:32:22 -0400 Subject: [PATCH] Always delete tradeship on pathfinding fail (#921) Fixes #912 ## Description: Always delete tradeship on pathfinding fail ## Please complete the following: - [x] I have added screenshots for all UI updates - [ ] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> --- src/core/execution/TradeShipExecution.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts index e25647544..927140cb4 100644 --- a/src/core/execution/TradeShipExecution.ts +++ b/src/core/execution/TradeShipExecution.ts @@ -171,9 +171,7 @@ export class TradeShipExecution implements Execution { } case PathFindResultType.PathNotFound: consolex.warn("trade ship cannot find route"); - if (this.tradeShip!.isActive()) { - this.tradeShip!.delete(false); - } + this.tradeShip?.delete(false); this.active = false; break; default: