diff options
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 8 | ||||
-rw-r--r-- | src/saveload/oldloader_sl.cpp | 2 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 3 | ||||
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 3 |
4 files changed, 13 insertions, 3 deletions
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 */ diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index e846c1ce5..d177e7207 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1138,7 +1138,7 @@ static const OldChunks vehicle_chunk[] = { OCL_VAR ( OC_UINT16, 1, &_old_order ), OCL_NULL ( 1 ), ///< num_orders, now calculated - OCL_SVAR( OC_UINT8, Vehicle, cur_order_index ), + OCL_SVAR( OC_UINT8, Vehicle, cur_auto_order_index ), OCL_SVAR( OC_TILE, Vehicle, dest_tile ), OCL_SVAR( OC_UINT16, Vehicle, load_unload_ticks ), OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Vehicle, date_of_last_service ), diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index ec0bec7b1..552b008ab 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -222,8 +222,9 @@ * 155 21453 * 156 21728 * 157 21862 + * 158 21933 */ -extern const uint16 SAVEGAME_VERSION = 157; ///< Current savegame version of OpenTTD. +extern const uint16 SAVEGAME_VERSION = 158; ///< Current savegame version of OpenTTD. SavegameType _savegame_type; ///< type of savegame we are loading diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index 8abcb916b..d1558d966 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -487,7 +487,8 @@ const SaveLoad *GetVehicleDescription(VehicleType vt) SLE_VAR(Vehicle, tick_counter, SLE_UINT8), SLE_CONDVAR(Vehicle, running_ticks, SLE_UINT8, 88, SL_MAX_VERSION), - SLE_VAR(Vehicle, cur_order_index, SLE_UINT8), + SLE_VAR(Vehicle, cur_auto_order_index, SLE_UINT8), + SLE_CONDVAR(Vehicle, cur_real_order_index, SLE_UINT8, 158, SL_MAX_VERSION), /* num_orders is now part of OrderList and is not saved but counted */ SLE_CONDNULL(1, 0, 104), |