Skip to content

Commit

Permalink
Fix AI not building buildings in the Space biome.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 9f8a5a740a1b0f5b50ec4bcbc7dd1a4c8e94b04e
  • Loading branch information
cpojer committed Mar 10, 2025
1 parent e71eb8d commit fa71432
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dionysus/DionysusAlpha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ export default class DionysusAlpha extends BaseAI {
};

this._canBuildFundsBuildings =
!map.config.blocklistedBuildings.size ||
check(exampleVector) ||
map.reduceEachField((canBuildFundsBuilding, vector) => {
if (canBuildFundsBuilding) {
Expand Down Expand Up @@ -542,7 +541,7 @@ export default class DionysusAlpha extends BaseAI {
}

let _funds: number | null = null;
const getFunds = () =>
const getFundsPerTurn = () =>
_funds == null ? (_funds = calculateFunds(map, currentPlayer)) : _funds;

let _allowAnyBuilding: boolean | null = null;
Expand All @@ -557,7 +556,7 @@ export default class DionysusAlpha extends BaseAI {
const shouldBuild = (info: BuildingInfo) =>
getAllowAnyBuilding()
? info.configuration.funds > 0 ||
getFunds() > 0 ||
getFundsPerTurn() > 0 ||
!this.getCanBuildFundsBuildings(map, currentPlayer, from)
: info.canBuildUnits();

Expand Down

0 comments on commit fa71432

Please sign in to comment.