mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 14:04:14 +00:00
bugfix: destroys not capturing tradeships
This commit is contained in:
@@ -44,17 +44,18 @@ export class TradeShipExecution implements Execution {
|
||||
this.active = false
|
||||
return
|
||||
}
|
||||
if (!this.dstPort.isActive() || !this.tradeShip.owner().isAlliedWith(this.dstPort.owner())) {
|
||||
this.tradeShip.delete()
|
||||
this.active = false
|
||||
return
|
||||
}
|
||||
|
||||
if (this.origOwner != this.tradeShip.owner()) {
|
||||
// Store as vairable in case ship is recaptured by previous owner
|
||||
this.wasCaptured = true
|
||||
}
|
||||
|
||||
if (!this.wasCaptured && (!this.dstPort.isActive() || !this.tradeShip.owner().isAlliedWith(this.dstPort.owner()))) {
|
||||
this.tradeShip.delete()
|
||||
this.active = false
|
||||
return
|
||||
}
|
||||
|
||||
if (this.wasCaptured) {
|
||||
const ports = this.tradeShip.owner().units(UnitType.Port).sort(distSortUnit(this.tradeShip))
|
||||
if (ports.length == 0) {
|
||||
|
||||
Reference in New Issue
Block a user