bufix: ports execution still active after port dies

This commit is contained in:
Evan
2024-11-29 17:10:28 -08:00
parent 4899196613
commit 7a961c68b4
3 changed files with 9 additions and 6 deletions
+1 -2
View File
@@ -201,8 +201,7 @@
* run a* in a web worker DONE 11/29/2024
* create async pathfinder DONE 11/29/2024
* captured tradeships use async pathfinder DONE 11/29/2024
* run name calculation in web worker
* BUG: tradeships wrong color
* BUG: trade ships not building DONE 11/29/2024
* have NPCs build destroyers and battleships
* spread out calculate clusters
* add radiation from nuke
+4 -4
View File
@@ -5,7 +5,7 @@ export const devConfig = new class extends DefaultConfig {
unitInfo(type: UnitType): UnitInfo {
const info = super.unitInfo(type)
const oldCost = info.cost
info.cost = (p: Player) => oldCost(p) / 5
info.cost = (p: Player) => oldCost(p) / 10
return info
}
@@ -25,9 +25,9 @@ export const devConfig = new class extends DefaultConfig {
turnIntervalMs(): number {
return 100
}
boatMaxDistance(): number {
return 5000
}
// boatMaxDistance(): number {
// return 5000
// }
// numBots(): number {
// return 0
+4
View File
@@ -49,6 +49,10 @@ export class PortExecution implements Execution {
}
this.port = player.buildUnit(UnitType.Port, 0, spawns[0])
}
if (!this.port.isActive()) {
this.active = false
return
}
const alliedPorts = this.player().alliances().map(a => a.other(this.player())).flatMap(p => p.units(UnitType.Port))