From 6358a995c4cc9a190fc6ddf93b17be7c1d045183 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 21 Oct 2023 06:56:03 +0300 Subject: [PATCH 36/36] AI: Make hunter to launch only its own cargo They were considering all missiles on the same tile, regardless of their carrier. See osdn #48627 Signed-off-by: Marko Lindqvist --- ai/default/daihunter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ai/default/daihunter.c b/ai/default/daihunter.c index bdc0339ec6..e4c06f7641 100644 --- a/ai/default/daihunter.c +++ b/ai/default/daihunter.c @@ -308,7 +308,8 @@ static void dai_hunter_try_launch(struct ai_type *ait, struct pf_map *pfm; const struct civ_map *nmap = &(wld.map); - unit_list_iterate_safe(unit_tile(punit)->units, missile) { + /* Only directly transported units. Not launching cargo of cargo */ + unit_list_iterate_safe(punit->transporting, missile) { struct unit *sucker = NULL; if (unit_owner(missile) == pplayer @@ -360,6 +361,7 @@ static void dai_hunter_try_launch(struct ai_type *ait, } } pf_map_move_costs_iterate_end; pf_map_destroy(pfm); + if (sucker) { if (unit_transported(missile)) { struct unit *ptrans = unit_transport_get(missile); -- 2.42.0