Add train cache flag for whether train using realistic braking physics

This commit is contained in:
Jonathan G Rennison
2021-04-15 19:39:36 +01:00
parent b514d29db1
commit ba2e6087b2
8 changed files with 30 additions and 20 deletions

View File

@@ -1033,7 +1033,7 @@ CommandCost CheckTrainReservationPreventsTrackModification(TileIndex tile, Track
CommandCost CheckTrainReservationPreventsTrackModification(const Train *v)
{
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && v != nullptr && (v->cur_speed > 0 || !(v->vehstatus & (VS_STOPPED | VS_CRASHED)))) {
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && v != nullptr && v->UsingRealisticBraking() && (v->cur_speed > 0 || !(v->vehstatus & (VS_STOPPED | VS_CRASHED)))) {
return_cmd_error(STR_ERROR_CANNOT_MODIFY_TRACK_TRAIN_APPROACHING);
}
return CommandCost();