From c82b3b27dda63b54e02f2e7187f6d63402bf15c6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 22 Oct 2019 21:30:14 +0200 Subject: [PATCH] =?UTF-8?q?Bug=202616:=20FOLGE=20schiesst=20=C3=BCber=20da?= =?UTF-8?q?s=20Ziel=20hinaus.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/move.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/move.c b/src/move.c index 484ee993f..7a636d2f0 100644 --- a/src/move.c +++ b/src/move.c @@ -2227,6 +2227,7 @@ int follow_ship(unit * u, order * ord) int moves, id, speed; char command[256]; direction_t dir; + ship *sh; if (fval(u, UFL_NOTMOVING)) { return 0; @@ -2251,10 +2252,10 @@ int follow_ship(unit * u, order * ord) return 0; } + sh = findship(id); dir = hunted_dir(rc->attribs, id); if (dir == NODIRECTION) { - ship *sh = findship(id); if (sh == NULL || sh->region != rc) { cmistake(u, ord, 20, MSG_MOVE); } @@ -2278,7 +2279,7 @@ int follow_ship(unit * u, order * ord) speed = maxspeed; } rc = rconnect(rc, dir); - while (rc && moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION) { + while (rc && rc != sh->region && moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION) { const char *loc = LOC(u->faction->locale, directions[dir]); sbs_strcat(&sbcmd, " "); sbs_strcat(&sbcmd, loc);