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
commit3940ed7e6f0bcb4fbe74c632254d6824692864dd (patch)
treec4fa100b773d9230e686f51621516b6a25cde8aa
parentfac5cee3d3a0dd116f548c92a569c5cb58ed29ee (diff)
downloadopenttd-3940ed7e6f0bcb4fbe74c632254d6824692864dd.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;