summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-17 16:25:32 +0000
committerfrosch <frosch@openttd.org>2009-01-17 16:25:32 +0000
commit2850bf9e006ebdd40b5562cca5117bca027cfab5 (patch)
treec4fa100b773d9230e686f51621516b6a25cde8aa
parent4bc7afae41f347be2f74bdfc993827c5ada655bd (diff)
downloadopenttd-2850bf9e006ebdd40b5562cca5117bca027cfab5.tar.xz
(svn r15125) -Fix [FS#2544]: Do not try to determine the next order destination, if there are no orders.
-rw-r--r--src/train_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 7f8f1678e..6aa7eda90 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2839,6 +2839,8 @@ public:
*/
bool SwitchToNextOrder(bool skip_first)
{
+ if (this->v->GetNumOrders() == 0) return false;
+
if (skip_first) ++this->index;
int conditional_depth = 0;