mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 16:46:50 +00:00
bugfix: destroys not capturing tradeships
This commit is contained in:
@@ -192,6 +192,8 @@
|
||||
* BUG: fix matchmaking DONE 11/22/2024
|
||||
* destroyer can capture trade ships DONE 11/22/2024
|
||||
* have bots recapture after nuclear blast DONE 11/24/2022
|
||||
* BUG: destroys destroy trade ships instead of capturing them DONE 11/25/2024
|
||||
* nukes break alliance
|
||||
* don't capture trade ships if allied with either port
|
||||
* make ports cost more for more ports
|
||||
* BUG: Destroyers destroy instead of capture trade ships
|
||||
|
||||
@@ -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