diff options
author | terkhen <terkhen@openttd.org> | 2010-03-06 12:56:57 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-03-06 12:56:57 +0000 |
commit | c958c2c31f0f04cdf66dfae0b95743011202655a (patch) | |
tree | 0e5d74d9cf5d50a10f2733c3c40eb190cb2163ea /src/settings.cpp | |
parent | e770b3d6bbd6fa35f9f921232c965f1c306d1b85 (diff) | |
download | openttd-c958c2c31f0f04cdf66dfae0b95743011202655a.tar.xz |
(svn r19345) -Feature: Realistic acceleration for road vehicles.
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 051a11e11..b190292e4 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -64,6 +64,7 @@ #include "company_base.h" #include "engine_base.h" #include "smallmap_gui.h" +#include "roadveh.h" #include "void_map.h" #include "station_base.h" @@ -774,6 +775,25 @@ static bool TrainSlopeSteepnessChanged(int32 p1) return true; } +/** + * This function updates realistic acceleration caches when the setting "Road vehicle acceleration model" is set. + * @param p1 Callback parameter + * @return Always true + */ +static bool RoadVehAccelerationModelChanged(int32 p1) +{ + if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) { + RoadVehicle *rv; + FOR_ALL_ROADVEHICLES(rv) { + if (rv->IsRoadVehFront()) { + rv->CargoChanged(); + } + } + } + + return true; +} + static bool DragSignalsDensityChanged(int32) { InvalidateWindowData(WC_BUILD_SIGNAL, 0); |