From fc0993323110039b58ea18a23dce4d4d9385568c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 3 Jul 2022 09:05:30 +0300 Subject: [PATCH 11/11] Fix dai_is_unit_tired_waiting_boat() crash Even if the unit had no homecity, homecity tile would have been used. I don't know if it's actually possible for a unit without homecity to ever end evaluated here with the current codebase. See osdn #44987 Signed-off-by: Marko Lindqvist --- ai/default/aiunit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ai/default/aiunit.c b/ai/default/aiunit.c index 704430ea84..69f7bdf888 100644 --- a/ai/default/aiunit.c +++ b/ai/default/aiunit.c @@ -2063,8 +2063,10 @@ static bool dai_is_unit_tired_waiting_boat(struct ai_type *ait, if (src == NULL || dest == NULL) { return FALSE; } - /* if we're not at home continent */ - if (tile_continent(src) != tile_continent(src_home_city)) { + + /* If we have a home continent, and are not there. */ + if (src_home_city != NULL + && tile_continent(src) != tile_continent(src_home_city)) { return FALSE; } -- 2.35.1