From dd03e2e8b548a6a3cbb550b8e95bf90d3b1a43d9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 14 Jul 2022 16:35:09 +0300 Subject: [PATCH 40/40] dai_effect_value(): Drop unused government parameter See osdn #44713 Signed-off-by: Marko Lindqvist --- ai/default/aitech.c | 3 +-- ai/default/daicity.c | 3 +-- ai/default/daidata.c | 2 +- ai/default/daieffects.c | 2 +- ai/default/daieffects.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ai/default/aitech.c b/ai/default/aitech.c index 451ea4ff2c..cb466dd422 100644 --- a/ai/default/aitech.c +++ b/ai/default/aitech.c @@ -234,7 +234,6 @@ static void dai_tech_effect_values(struct ai_type *ait, struct player *pplayer) { /* TODO: Currently this duplicates code from aicity.c improvement effect * evaluating almost verbose - refactor so that they can share code. */ - struct government *gov = government_of_player(pplayer); struct adv_data *adv = adv_data_get(pplayer, NULL); struct ai_plr *aip = def_ai_player_data(pplayer, ait); int turns = 9999; /* TODO: Set to correct value */ @@ -289,7 +288,7 @@ static void dai_tech_effect_values(struct ai_type *ait, struct player *pplayer) if (active) { adv_want v1; - v1 = dai_effect_value(pplayer, gov, adv, pcity, capital, + v1 = dai_effect_value(pplayer, adv, pcity, capital, turns, peffect, 1, nplayers); diff --git a/ai/default/daicity.c b/ai/default/daicity.c index 14a4dc5158..532d57d2d6 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -1578,7 +1578,6 @@ static void adjust_improvement_wants_by_effects(struct ai_type *ait, struct adv_data *ai = adv_data_get(pplayer, NULL); bool capital = is_capital(pcity); bool can_build = TRUE; - struct government *gov = government_of_player(pplayer); struct universal source = { .kind = VUT_IMPROVEMENT, .value = {.building = pimprove} @@ -1711,7 +1710,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, gov, ai, pcity, capital, + adv_want v1 = dai_effect_value(pplayer, ai, pcity, capital, turns, peffect, cities[mypreq->range], nplayers); /* v1 could be negative (the effect could be undesirable), diff --git a/ai/default/daidata.c b/ai/default/daidata.c index e2063fb9bd..00e1dd0f7c 100644 --- a/ai/default/daidata.c +++ b/ai/default/daidata.c @@ -568,7 +568,7 @@ void dai_gov_value(struct ai_type *ait, struct player *pplayer, if (active) { adv_want v1; - v1 = dai_effect_value(pplayer, gov, adv, pcity, capital, + v1 = dai_effect_value(pplayer, adv, pcity, capital, turns, peffect, 1, nplayers); diff --git a/ai/default/daieffects.c b/ai/default/daieffects.c index cfd2896d93..fe80f6f344 100644 --- a/ai/default/daieffects.c +++ b/ai/default/daieffects.c @@ -135,7 +135,7 @@ static int num_affected_units(const struct effect *peffect, How desirable is a particular effect for a particular city, given the number of cities in range (c). **************************************************************************/ -adv_want dai_effect_value(struct player *pplayer, struct government *gov, +adv_want dai_effect_value(struct player *pplayer, const struct adv_data *adv, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, diff --git a/ai/default/daieffects.h b/ai/default/daieffects.h index 97ff7c7267..480c1ca170 100644 --- a/ai/default/daieffects.h +++ b/ai/default/daieffects.h @@ -13,7 +13,7 @@ #ifndef FC__DAI_EFFECTS_H #define FC__DAI_EFFECTS_H -adv_want dai_effect_value(struct player *pplayer, struct government *gov, +adv_want dai_effect_value(struct player *pplayer, const struct adv_data *adv, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, -- 2.35.1