From d03face3c16b6a2706d2b043393140deb8cb54be Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 16 Jan 2021 22:11:33 +0100 Subject: [PATCH] simplicate and add more lightness --- src/move.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/move.c b/src/move.c index 5f4c42c3e..0da6e17e0 100644 --- a/src/move.c +++ b/src/move.c @@ -892,11 +892,6 @@ static void drifting_ships(region * r) } } -static bool present(region * r, unit * u) -{ - return (u && u->region == r); -} - static void caught_target_ship(region* r, unit* u) { attrib* a = a_find(u->attribs, &at_follow); @@ -908,7 +903,7 @@ static void caught_target_ship(region* r, unit* u) if (a) { unit* target = (unit*)a->data.v; - if (target == u || !present(r, target)) { + if (target == u || r != target->region) { ADDMSG(&u->faction->msgs, msg_message("followfail_ship", "ship follower", target->ship, u->ship)); } @@ -931,7 +926,7 @@ static void caught_target(region * r, unit * u) if (a) { unit *target = (unit *)a->data.v; - if (target == u || !present(r, target)) { + if (target == u || r != target->region) { ADDMSG(&u->faction->msgs, msg_message("followfail", "unit follower", target, u)); }