Project

General

Profile

Actions

Bug #2456

open

ai: emergency-buy loop has been dead for a decade oops

Added by Sweet Tea Dorminy 3 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
AI
Target version:
-
Start date:
11/08/2026
Due date:
% Done:

0%

Estimated time:

Description

dai_manage_cities() resets every city's choice.want to -1, then calls dai_spend_gold(), which looks for the city with the highest want. Nothing beats zero, so the loop exits doing nothing. The reset moved ahead of the spend in c84ce356f5 (2017); the buy code has been maintained ever since, so this can't be intended.

Patch spends first, then resets; dai_spend_gold() already marks what it handled.

Same seed, 8 hard AIs, 120 turns: mean treasury 260 -> 66, units built 56 -> 66, mean score 81 -> 104.


Files

No data to display

Actions

Also available in: Atom PDF