don't alert on delete trade ship or shell

This commit is contained in:
Evan
2024-12-12 21:12:29 -08:00
parent 953a30970e
commit 2816ba1807
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -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
}
}
+4 -4
View File
@@ -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])