Actions
Bug #2485
openAI rates building effects too low
Start date:
11/15/2026
Due date:
% Done:
0%
Estimated time:
Description
When the AI weighs a building, effects are multiplied by the number of cities reached. That number is currently wrong: a City range building is counted as reaching 4 cities, and a Player or World range wonder as reaching 7 or 10, whatever the size of the empire.
The cause is adjust_improvement_wants_by_effects(): it counts our cities-per-size-range into cities[], but then hands dai_effect_value() the range itself rather than cities[range], and 4, 7 and 10 are the enum values of City, Player and World range. The line was cities[mypreq->range] until osdn #47831 (2023), so this is in every 3.2 release.
Attached patch passes cities[range]. One patch applies to main, S3_3 and S3_2
Files
Actions