From 2816ba18074c6a56714f395f3a7500e2fffbbe54 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 12 Dec 2024 21:12:29 -0800 Subject: [PATCH] don't alert on delete trade ship or shell --- src/core/execution/ShellExecution.ts | 6 +++--- src/core/execution/TradeShipExecution.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/execution/ShellExecution.ts b/src/core/execution/ShellExecution.ts index e47f6ef67..b3b17a0df 100644 --- a/src/core/execution/ShellExecution.ts +++ b/src/core/execution/ShellExecution.ts @@ -25,7 +25,7 @@ export class ShellExecution implements Execution { return } if (!this.target.isActive()) { - this.shell.delete() + this.shell.delete(false) this.active = false return } @@ -35,7 +35,7 @@ export class ShellExecution implements Execution { case PathFindResultType.Completed: this.active = false this.target.delete() - this.shell.delete() + this.shell.delete(false) return case PathFindResultType.NextTile: this.shell.move(result.tile) @@ -45,7 +45,7 @@ export class ShellExecution implements Execution { case PathFindResultType.PathNotFound: console.log(`Shell ${this.shell} could not find target`) this.active = false - this.shell.delete() + this.shell.delete(false) return } } diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts index ab30075cf..18f1bde47 100644 --- a/src/core/execution/TradeShipExecution.ts +++ b/src/core/execution/TradeShipExecution.ts @@ -53,7 +53,7 @@ export class TradeShipExecution implements Execution { } if (!this.wasCaptured && (!this.dstPort.isActive() || !this.tradeShip.owner().isAlliedWith(this.dstPort.owner()))) { - this.tradeShip.delete() + this.tradeShip.delete(false) this.active = false return } @@ -61,7 +61,7 @@ export class TradeShipExecution implements Execution { if (this.wasCaptured) { const ports = this.tradeShip.owner().units(UnitType.Port).sort(distSortUnit(this.tradeShip)) if (ports.length == 0) { - this.tradeShip.delete() + this.tradeShip.delete(false) this.active = false return } @@ -76,7 +76,7 @@ export class TradeShipExecution implements Execution { MessageType.SUCCESS, this.tradeShip.owner().id() ) - this.tradeShip.delete() + this.tradeShip.delete(false) break case PathFindResultType.Pending: // Fire unit event to rerender. @@ -101,7 +101,7 @@ export class TradeShipExecution implements Execution { this.dstPort.owner().addGold(gold) this.mg.displayMessage(`Received ${renderNumber(gold)} gold from trade with ${this.tradeShip.owner().displayName()}`, MessageType.SUCCESS, this.dstPort.owner().id()) this.mg.displayMessage(`Received ${renderNumber(gold)} gold from trade with ${this.tradeShip.owner().displayName()}`, MessageType.SUCCESS, this._owner) - this.tradeShip.delete() + this.tradeShip.delete(false) return } this.tradeShip.move(this.path[this.index])