changeset 10792:dcc9b146a749 draft

(svn r15125) -Fix [FS#2544]: Do not try to determine the next order destination, if there are no orders.
author frosch <frosch@openttd.org>
date Sat, 17 Jan 2009 16:25:32 +0000
parents e0371993d4fd
children 0744d383a56b
files src/train_cmd.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2839,6 +2839,8 @@
 	 */
 	bool SwitchToNextOrder(bool skip_first)
 	{
+		if (this->v->GetNumOrders() == 0) return false;
+
 		if (skip_first) ++this->index;
 
 		int conditional_depth = 0;