summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-13 09:12:10 +0000
committerrubidium <rubidium@openttd.org>2007-06-13 09:12:10 +0000
commit97b74fe4f205fc65fbc2e3933fd7cb4d08e8df33 (patch)
treee855c9d11b9ad195b591c66487cf1a9eb1fd7d33 /src
parent860fe49b805527f5eb6ef8d14dd74b14cc392ee8 (diff)
downloadopenttd-97b74fe4f205fc65fbc2e3933fd7cb4d08e8df33.tar.xz
(svn r10131) -Fix [FS#810]: when removing a dock, a ship will always try to reach the old location of the dock even when it cannot anymore because it the old location of the dock is now land instead of water.
Diffstat (limited to 'src')
-rw-r--r--src/ship_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 7c08b467a..dd5675800 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -280,7 +280,8 @@ static void ProcessShipOrder(Vehicle *v)
if (order->type == v->current_order.type &&
order->flags == v->current_order.flags &&
- order->dest == v->current_order.dest)
+ order->dest == v->current_order.dest &&
+ (order->type != OT_GOTO_STATION || GetStation(order->dest)->dock_tile != 0))
return;
v->current_order = *order;
@@ -294,6 +295,8 @@ static void ProcessShipOrder(Vehicle *v)
st = GetStation(order->dest);
if (st->dock_tile != 0) {
v->dest_tile = TILE_ADD(st->dock_tile, ToTileIndexDiff(GetDockOffset(st->dock_tile)));
+ } else {
+ v->cur_order_index++;
}
} else if (order->type == OT_GOTO_DEPOT) {
v->dest_tile = GetDepot(order->dest)->xy;