From f3147be36e7062786f4ec38380cad19da4f5e47c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 19 Feb 2022 19:31:12 +0200 Subject: [PATCH 10/39] AI: Alight unit when amphibious transport reaches destination See osdn #43639 Signed-off-by: Marko Lindqvist --- ai/default/aiferry.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ai/default/aiferry.c b/ai/default/aiferry.c index 2a92d9cf65..447cc9c0da 100644 --- a/ai/default/aiferry.c +++ b/ai/default/aiferry.c @@ -708,8 +708,13 @@ bool dai_amphibious_goto_constrained(struct ai_type *ait, } } /* else at sea */ + } else if (alive) { + /* Arrived all the way to the destination by boat. Alight. */ + if (can_unit_exist_at_tile(parameter->land.map, passenger, ptile)) { + unit_transport_unload_send(passenger); + } } - /* else dead or arrived */ + /* else dead */ } else { /* Not always an error; enemy units might block all paths. */ UNIT_LOG(LOG_DEBUG, passenger, "no path to destination"); -- 2.34.1