From e4b4cf0259a487a1d5ce933ff3fb7807ff448f1e Mon Sep 17 00:00:00 2001
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Date: Sat, 14 Nov 2026 13:57:55 -0800
Subject: [PATCH] adjust_improvement_wants_by_effects(): Pass city count, not
 range

dai_effect_value() takes the number of cities the effect reaches as c,
and the caller fills cities[] by range for that. Since the change to
buildings providing several requirements, the range itself is passed
instead, so c is the req_range enum value: 4 for City, 7 for Player,
10 for World.

That scales every c-weighted term of a building's want (content,
Make_Happy, Defend_Bonus, Veteran_Build, ...) by the enum: buildings
with City range by 4 instead of 1, wonders by 7 or 10 instead of the
number of our cities.

Pass cities[range] again.

See RM #2485

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
---
 ai/default/daicity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ai/default/daicity.c b/ai/default/daicity.c
index ddc5d549e2..603d1a4fcc 100644
--- a/ai/default/daicity.c
+++ b/ai/default/daicity.c
@@ -1763,7 +1763,7 @@ static void adjust_improvement_wants_by_effects(struct ai_type *ait,
     n_needed_techs = tech_vector_size(&needed_techs);
     if ((active || n_needed_techs) && !impossible_to_get) {
       adv_want v1 = dai_effect_value(pplayer, ai, pcity, capital,
-                                     turns, peffect, range, nplayers);
+                                     turns, peffect, cities[range], nplayers);
       /* v1 could be negative (the effect could be undesirable),
        * although it is usually positive.
        * For example, in the default ruleset, Communism decreases the
-- 
2.55.0

