From a97d52a29a990132a8a5e4dd60304483617cec50 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 31 Jan 2011 20:44:15 +0000 Subject: (svn r21933) -Codechange: Split cur_order_index into cur_auto_order_index and cur_real_order_index to keep track of the current real order in an unambiguous way. -Fix [FS#4440]: Automatic orders behave now stable wrt. service orders and are not added or removed depending on the need of servicing. -Fix: Various other issues with automatic orders, e.g. vehicles getting stuck with "no orders" when there are automatic orders at the end of the order list. --- src/saveload/afterload.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/saveload/afterload.cpp') diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 35a5579ba..5948415a6 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2536,6 +2536,14 @@ bool AfterLoadGame() * it should have set v->z_pos correctly. */ assert(v->tile != TileVirtXY(v->x_pos, v->y_pos) || v->z_pos == GetSlopeZ(v->x_pos, v->y_pos)); } + + /* Fill Vehicle::cur_real_order_index */ + FOR_ALL_VEHICLES(v) { + if (!v->IsPrimaryVehicle()) continue; + + v->cur_real_order_index = v->cur_auto_order_index; + v->UpdateRealOrderIndex(); + } } /* Road stops is 'only' updating some caches */ -- cgit v1.2.3-70-g09d2