mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:00:43 +00:00
fixed bug causing crash when capturing trade ship already captured by another destroyer
This commit is contained in:
@@ -24,12 +24,12 @@ export const devConfig = new class extends DefaultConfig {
|
||||
return 100
|
||||
}
|
||||
|
||||
numBots(): number {
|
||||
return 0
|
||||
}
|
||||
spawnNPCs(): boolean {
|
||||
return false
|
||||
}
|
||||
// numBots(): number {
|
||||
// return 0
|
||||
// }
|
||||
// spawnNPCs(): boolean {
|
||||
// return false
|
||||
// }
|
||||
|
||||
// boatMaxDistance(): number {
|
||||
// return 2000
|
||||
|
||||
@@ -77,6 +77,11 @@ export class DestroyerExecution implements Execution {
|
||||
}
|
||||
this.target = ships.sort(distSortUnit(this.destroyer))[0]
|
||||
}
|
||||
if (!this.target.isActive() || this.target.owner() == this._owner) {
|
||||
// Incase another destroyer captured or destroyed target
|
||||
this.target = null
|
||||
return
|
||||
}
|
||||
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const result = this.pathfinder.nextTile(this.destroyer.tile(), this.target.tile(), 5)
|
||||
|
||||
Reference in New Issue
Block a user