fix crash when following a lost ship

This commit is contained in:
Enno Rehling 2019-10-23 23:17:31 +02:00
parent 802fe20897
commit 533a0aceec
1 changed files with 1 additions and 1 deletions

View File

@ -2279,7 +2279,7 @@ int follow_ship(unit * u, order * ord)
speed = maxspeed;
}
rc = rconnect(rc, dir);
while (rc && rc != sh->region && moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION) {
while (rc && (!sh || 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);