Project

General

Profile

Actions

Bug #2485

open

AI rates building effects too low

Added by Sweet Tea Dorminy 14 days ago. Updated 13 days ago.

Status:
In Review
Priority:
Normal
Category:
AI
Target version:
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

Also available in: Atom PDF