summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-22 18:16:47 +0000
committerrubidium <rubidium@openttd.org>2012-01-22 18:16:47 +0000
commitf6487875daab0edf09423bd28f87bb008e93ea5c (patch)
tree960118d80ff54192851573b2791d62e8ac3ca68a
parent60678d97575ac4b277b5fc9bdac5146c0560f1d9 (diff)
downloadopenttd-f6487875daab0edf09423bd28f87bb008e93ea5c.tar.xz
(svn r23838) -Fix [FS#5000]: assertion got hit when destroing a dock when a ship was loading
-rw-r--r--src/station_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index fdf858f8c..2925d5a89 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2555,6 +2555,10 @@ static CommandCost RemoveDock(TileIndex tile, DoCommandFlag flags)
* wander around the world. */
Ship *s;
FOR_ALL_SHIPS(s) {
+ if (s->current_order.IsType(OT_LOADING) && s->tile == docking_location) {
+ s->LeaveStation();
+ }
+
if (s->dest_tile == docking_location) {
s->dest_tile = 0;
s->current_order.Free();