Add NewGRF railtype flag to disable realistic braking for vehs of that type

See: #242
This commit is contained in:
Jonathan G Rennison
2021-04-15 20:19:04 +01:00
parent ba2e6087b2
commit 6a62b94263
8 changed files with 29 additions and 6 deletions

View File

@@ -1073,7 +1073,7 @@ void Train::UpdateAcceleration()
assert(weight != 0);
this->acceleration = Clamp(power / weight * 4, 1, 255);
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && !HasBit(GetRailTypeInfo(this->railtype)->ctrl_flags, RTCF_NOREALISTICBRAKING)) {
this->tcache.cached_tflags |= TCF_RL_BRAKING;
switch (_settings_game.vehicle.train_acceleration_model) {
default: NOT_REACHED();