From a09491d21b1d55ce8a21b9252ab524b75b41d416 Mon Sep 17 00:00:00 2001 From: Ihnatus Date: Mon, 7 Jun 2021 00:04:55 +0300 Subject: [PATCH] AI: remove immediate_destination() from dai_unit_goto_constrained() Unnecessary check that sometimes freezed fueled ferries. See OSDN #41970 Signed-off-by: Ihnatus --- ai/default/aitools.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ai/default/aitools.c b/ai/default/aitools.c index cfdd77d7c6..f02d23030c 100644 --- a/ai/default/aitools.c +++ b/ai/default/aitools.c @@ -402,19 +402,13 @@ bool dai_unit_goto_constrained(struct ai_type *ait, struct unit *punit, UNIT_LOG(LOG_DEBUG, punit, "constrained goto to %d,%d", TILE_XY(ptile)); - ptile = immediate_destination(punit, ptile); - - UNIT_LOG(LOG_DEBUG, punit, "constrained goto: let's go to %d,%d", - TILE_XY(ptile)); - if (same_pos(unit_tile(punit), ptile)) { - /* Not an error; sometimes immediate_destination instructs the unit - * to stay here. For example, to refuel.*/ + /* Was not an error in previous versions but now is dubious... */ UNIT_LOG(LOG_DEBUG, punit, "constrained goto: already there!"); send_unit_info(NULL, punit); return TRUE; - } else if (!goto_is_sane(punit, ptile)) { + } else if (!goto_is_sane(punit, ptile)) {/* FIXME: why do we check it? */ UNIT_LOG(LOG_DEBUG, punit, "constrained goto: 'insane' goto!"); punit->activity = ACTIVITY_IDLE; send_unit_info(NULL, punit); -- 2.27.0