| 310 | } |
| 311 | |
| 312 | static void TrainAccelerationModelChanged(int32_t) |
| 313 | { |
| 314 | for (Train *t : Train::Iterate()) { |
| 315 | if (t->IsFrontEngine()) { |
| 316 | t->tcache.cached_max_curve_speed = t->GetCurveSpeedLimit(); |
| 317 | t->UpdateAcceleration(); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | /* These windows show acceleration values only when realistic acceleration is on. They must be redrawn after a setting change. */ |
| 322 | SetWindowClassesDirty(WC_ENGINE_PREVIEW); |
| 323 | InvalidateWindowClassesData(WC_BUILD_VEHICLE, 0); |
| 324 | SetWindowClassesDirty(WC_VEHICLE_DETAILS); |
| 325 | } |
| 326 | |
| 327 | /** |
| 328 | * This function updates the train acceleration cache after a steepness change. |
nothing calls this directly
no test coverage detected