summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-11-09 17:43:05 +0000
committerterkhen <terkhen@openttd.org>2010-11-09 17:43:05 +0000
commit6a38925ca3d3865f7f9de8cee37a6226d12af4d9 (patch)
tree479ce8e41b6c5cd1e74656d66462205c96e885d0 /src/saveload
parente1ff8aeb09cded7fe1651f0a7fa06d145d723607 (diff)
downloadopenttd-6a38925ca3d3865f7f9de8cee37a6226d12af4d9.tar.xz
(svn r21123) -Codechange: Remove max_speed from the Vehicle class.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp1
-rw-r--r--src/saveload/oldloader_sl.cpp4
-rw-r--r--src/saveload/vehicle_sl.cpp5
3 files changed, 5 insertions, 5 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index b12b4c469..b7908525f 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1340,7 +1340,6 @@ bool AfterLoadGame()
const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
v->cur_speed *= 128;
v->cur_speed /= 10;
- v->max_speed = avi->max_speed;
v->acceleration = avi->acceleration;
}
}
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index 59e18bf6f..b360a2da6 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -1133,8 +1133,8 @@ static const OldChunks vehicle_chunk[] = {
OCL_SVAR( OC_UINT16, Vehicle, service_interval ),
OCL_SVAR( OC_FILE_U8 | OC_VAR_U16, Vehicle, last_station_visited ),
OCL_SVAR( OC_TTD | OC_UINT8, Vehicle, tick_counter ),
- OCL_SVAR( OC_TTD | OC_UINT16, Vehicle, max_speed ),
- OCL_SVAR( OC_TTO | OC_FILE_U8 | OC_VAR_U16, Vehicle, max_speed ),
+ OCL_CNULL( OC_TTD, 2 ), ///< max_speed, now it is calculated.
+ OCL_CNULL( OC_TTO, 1 ), ///< max_speed, now it is calculated.
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Vehicle, x_pos ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Vehicle, y_pos ),
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 7817e81ba..5aea72a9f 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -180,7 +180,8 @@ void UpdateOldAircraft()
AircraftLeaveHangar(a); // make airplane visible if it was in a depot for example
a->vehstatus &= ~VS_STOPPED; // make airplane moving
- a->cur_speed = a->max_speed; // so aircraft don't have zero speed while in air
+ UpdateAircraftCache(a);
+ a->cur_speed = a->vcache.cached_max_speed; // so aircraft don't have zero speed while in air
if (!a->current_order.IsType(OT_GOTO_STATION) && !a->current_order.IsType(OT_GOTO_DEPOT)) {
/* reset current order so aircraft doesn't have invalid "station-only" order */
a->current_order.MakeDummy();
@@ -443,7 +444,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
SLE_CONDNULL(5, 0, 57),
SLE_VAR(Vehicle, engine_type, SLE_UINT16),
- SLE_VAR(Vehicle, max_speed, SLE_UINT16),
+ SLE_CONDNULL(2, 0, 151),
SLE_VAR(Vehicle, cur_speed, SLE_UINT16),
SLE_VAR(Vehicle, subspeed, SLE_UINT8),
SLE_VAR(Vehicle, acceleration, SLE_UINT8),