From b657873488eb5b74a8c0fcfa164280cb4e2704cc Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 12 Aug 2020 01:22:07 +0200 Subject: [PATCH] let swimming and flying units follow a ship --- src/move.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/move.c b/src/move.c index a92f52a96..173aa709d 100644 --- a/src/move.c +++ b/src/move.c @@ -2233,15 +2233,17 @@ int follow_ship(unit * u, order * ord) if (fval(u, UFL_NOTMOVING)) { return 0; } - else if (!u->ship) { - cmistake(u, ord, 144, MSG_MOVE); - return 0; + if (!fval(u_race(u), RCF_FLY|RCF_SWIM)) { + if (!u->ship) { + cmistake(u, ord, 144, MSG_MOVE); + return 0; + } } - else if (u != ship_owner(u->ship)) { + else if (u->ship && u != ship_owner(u->ship)) { cmistake(u, ord, 146, MSG_MOVE); return 0; } - else if (!can_move(u)) { + if (!can_move(u)) { cmistake(u, ord, 55, MSG_MOVE); return 0; }