diff options
author | rubidium <rubidium@openttd.org> | 2007-10-18 20:32:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-18 20:32:36 +0000 |
commit | f034036ef413672b1f625f433cea268fde5f1db8 (patch) | |
tree | a112f1b6faed4c246b79871dfef97e00e27af136 /src | |
parent | 6f75794b0f138f22ae468866914b20e748c54a8b (diff) | |
download | openttd-f034036ef413672b1f625f433cea268fde5f1db8.tar.xz |
(svn r11291) -Fix [FS#1345]: changing the wagon_speed_limits patch option caused desyncs.
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 8b1adf0c9..4e35b1954 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -41,6 +41,7 @@ #include "genworld.h" #include "date.h" #include "rail.h" +#include "train.h" #include "helpers.hpp" #include "news.h" #ifdef WITH_FREETYPE @@ -1135,6 +1136,16 @@ static int32 InvalidateStationBuildWindow(int32 p1) return 0; } +static int32 UpdateConsists(int32 p1) +{ + Vehicle *v; + FOR_ALL_VEHICLES(v) { + /* Update the consist of all trains so the maximum speed is set correctly. */ + if (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v))) TrainConsistChanged(v); + } + return 0; +} + /* Check service intervals of vehicles, p1 is value of % or day based servicing */ static int32 CheckInterval(int32 p1) { @@ -1403,7 +1414,7 @@ const SettingDesc _patch_settings[] = { SDT_VAR(Patches, servint_ships, SLE_UINT16, 0,D0, 360, 5, 800, 0, STR_CONFIG_PATCHES_SERVINT_SHIPS, InValidateDetailsWindow), SDT_VAR(Patches, servint_aircraft, SLE_UINT16, 0,D0, 100, 5, 800, 0, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, InValidateDetailsWindow), SDT_BOOL(Patches, no_servicing_if_no_breakdowns, 0, 0, false, STR_CONFIG_PATCHES_NOSERVICE, NULL), - SDT_BOOL(Patches, wagon_speed_limits, 0, 0, true, STR_CONFIG_PATCHES_WAGONSPEEDLIMITS, NULL), + SDT_BOOL(Patches, wagon_speed_limits, 0, 0, true, STR_CONFIG_PATCHES_WAGONSPEEDLIMITS, UpdateConsists), SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, 0, false, STR_CONFIG_PATCHES_DISABLE_ELRAILS, SettingsDisableElrail), SDT_CONDVAR(Patches, freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0, 0, 1, 1, 255, 1, STR_CONFIG_PATCHES_FREIGHT_TRAINS, NULL), SDT_CONDBOOL(Patches, timetabling, 67, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_PATCHES_TIMETABLE_ALLOW, NULL), |