From e1757cd44f6c6a551c1aaa8c1759b67bafcb6a1c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 19 Aug 2022 16:26:42 +0300 Subject: [PATCH 4/4] AI: Actively select tech on team with no pooled research AI was assuming that human team mate will choose the tech even when they don't share the research. See osdn #45397 Signed-off-by: Marko Lindqvist --- ai/default/aitech.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ai/default/aitech.c b/ai/default/aitech.c index 90d75482fd..064b95ed52 100644 --- a/ai/default/aitech.c +++ b/ai/default/aitech.c @@ -322,13 +322,11 @@ void dai_manage_tech(struct ai_type *ait, struct player *pplayer) dai_tech_effect_values(ait, pplayer); /* If there are humans in our team, they will choose the techs */ - players_iterate(aplayer) { - const struct player_diplstate *ds = player_diplstate_get(pplayer, aplayer); - - if (ds->type == DS_TEAM) { + research_players_iterate(research, aplayer) { + if (!aplayer->ai_controlled) { return; } - } players_iterate_end; + } research_players_iterate_end; dai_select_tech(ait, pplayer, &choice, &goal); if (choice.choice != research->researching) { -- 2.35.1