From ad1e129e736f9634fd80ce1fa17a8e6fff1eab72 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 19 Feb 2022 19:31:12 +0200 Subject: [PATCH 05/14] 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 f2c3bdda6f..0d3fae74a6 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(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