defense posts builds by bots require 1 city

This commit is contained in:
1brucben
2025-04-25 23:31:21 +02:00
parent 41ec783aa4
commit 63f5a7858e
+2 -1
View File
@@ -474,6 +474,7 @@ export class FakeHumanExecution implements Execution {
}
if (currentTick - this.lastDefensePostTick >= 100) {
this.lastDefensePostTick = currentTick;
const hasCity = this.player.units(UnitType.City).length >= 1;
const defensePostsCount = this.player.units(UnitType.DefensePost).length;
const borderTiles = new Set(this.player.borderTiles());
const defensePostRatio = defensePostsCount / borderTiles.size;
@@ -482,7 +483,7 @@ export class FakeHumanExecution implements Execution {
const canAffordDefensePost =
this.player.gold() >= this.cost(UnitType.DefensePost);
if (defensePostDeficit > 0 && canAffordDefensePost) {
if (defensePostDeficit > 0 && canAffordDefensePost && hasCity) {
const borderTiles = new Set(this.player.borderTiles());
const existingPosts = this.player
.units(UnitType.DefensePost)