Fix misspelling of variable name: acceleration_type
This commit is contained in:
@@ -156,8 +156,8 @@ GroundVehicleAcceleration GroundVehicle<T, Type>::GetAcceleration()
|
|||||||
*/
|
*/
|
||||||
int64 resistance = 0;
|
int64 resistance = 0;
|
||||||
|
|
||||||
int accleration_type = v->GetAccelerationType();
|
int acceleration_type = v->GetAccelerationType();
|
||||||
bool maglev = (accleration_type == 2);
|
bool maglev = (acceleration_type == 2);
|
||||||
|
|
||||||
const int area = v->GetAirDragArea();
|
const int area = v->GetAirDragArea();
|
||||||
if (!maglev) {
|
if (!maglev) {
|
||||||
@@ -251,7 +251,7 @@ GroundVehicleAcceleration GroundVehicle<T, Type>::GetAcceleration()
|
|||||||
|
|
||||||
/* Defensive driving: prevent ridiculously fast deceleration.
|
/* Defensive driving: prevent ridiculously fast deceleration.
|
||||||
* -130 corresponds to a braking distance of about 6.2 tiles from 160 km/h. */
|
* -130 corresponds to a braking distance of about 6.2 tiles from 160 km/h. */
|
||||||
braking_accel = std::max(braking_accel, -(GetTrainRealisticBrakingTargetDecelerationLimit(accleration_type) + 10));
|
braking_accel = std::max(braking_accel, -(GetTrainRealisticBrakingTargetDecelerationLimit(acceleration_type) + 10));
|
||||||
} else {
|
} else {
|
||||||
braking_accel = ClampToI32(std::min<int64>(-braking_force - resistance, -10000) / mass);
|
braking_accel = ClampToI32(std::min<int64>(-braking_force - resistance, -10000) / mass);
|
||||||
}
|
}
|
||||||
|
@@ -1030,8 +1030,8 @@ void Train::UpdateAcceleration()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AM_REALISTIC: {
|
case AM_REALISTIC: {
|
||||||
int accleration_type = this->GetAccelerationType();
|
int acceleration_type = this->GetAccelerationType();
|
||||||
bool maglev = (accleration_type == 2);
|
bool maglev = (acceleration_type == 2);
|
||||||
int64 power_w = power * 746ll;
|
int64 power_w = power * 746ll;
|
||||||
int64 min_braking_force = this->gcache.cached_total_length * 300;
|
int64 min_braking_force = this->gcache.cached_total_length * 300;
|
||||||
if (!maglev) {
|
if (!maglev) {
|
||||||
@@ -1073,7 +1073,7 @@ void Train::UpdateAcceleration()
|
|||||||
}
|
}
|
||||||
min_braking_force -= (min_braking_force >> 3); // Slightly underestimate braking for defensive driving purposes
|
min_braking_force -= (min_braking_force >> 3); // Slightly underestimate braking for defensive driving purposes
|
||||||
this->tcache.cached_uncapped_decel = Clamp(min_braking_force / weight, 1, UINT16_MAX);
|
this->tcache.cached_uncapped_decel = Clamp(min_braking_force / weight, 1, UINT16_MAX);
|
||||||
this->tcache.cached_deceleration = Clamp(this->tcache.cached_uncapped_decel, 1, GetTrainRealisticBrakingTargetDecelerationLimit(accleration_type));
|
this->tcache.cached_deceleration = Clamp(this->tcache.cached_uncapped_decel, 1, GetTrainRealisticBrakingTargetDecelerationLimit(acceleration_type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user