From 2850bf9e006ebdd40b5562cca5117bca027cfab5 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 17 Jan 2009 16:25:32 +0000 Subject: [PATCH] (svn r15125) -Fix [FS#2544]: Do not try to determine the next order destination, if there are no orders. --- src/train_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 7f8f1678ea..6aa7eda904 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;