(svn r21123) -Codechange: Remove max_speed from the Vehicle class.

This commit is contained in:
terkhen
2010-11-09 17:43:05 +00:00
parent 10d4b2f51f
commit c7a2d1f883
9 changed files with 12 additions and 18 deletions

View File

@@ -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;
}
}

View File

@@ -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 ),

View File

@@ -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),