From f18f6f8ecee6690bfade3352be80ca31e3809057 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 26 Dec 2009 07:46:33 +0000 Subject: [PATCH] crash ROUTE & buildingowner --- src/common/kernel/move.c | 4 ++++ src/common/kernel/unit.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/kernel/move.c b/src/common/kernel/move.c index 7624d37a9..1c9b8fe2c 100644 --- a/src/common/kernel/move.c +++ b/src/common/kernel/move.c @@ -1961,6 +1961,10 @@ travel_i(unit * u, const region_list * route_begin, const region_list * route_en { region * r = u->region; + if (u->building && !can_leave(u)) { + cmistake(u, u->thisorder, 150, MSG_MOVE); + return route_begin; + } switch (canwalk(u)) { case E_CANWALK_TOOHEAVY: cmistake(u, ord, 57, MSG_MOVE); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index ab6b7613c..9eba732d9 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -843,7 +843,9 @@ boolean leave(unit * u, boolean force) { if (!force) { - if (!can_leave(u)) return false; + if (!can_leave(u)) { + return false; + } } if (u->building) leave_building(u); else if (u->ship) leave_ship(u);