Clear state when setting changed

pull/281/head
Jonathan G Rennison 3 years ago
parent e15acd3af8
commit 879a23811f

@ -1541,6 +1541,15 @@ static bool PublicRoadsSettingChange(int32 p1) {
return true;
}
static bool TrainSpeedAdaptionChanged(int32 p1) {
extern void ClearAllSignalSpeedRestrictions();
ClearAllSignalSpeedRestrictions();
for (Train *t : Train::Iterate()) {
t->signal_speed_restriction = 0;
}
return true;
}
/** Checks if any settings are set to incorrect values, and sets them to correct values in that case. */
static void ValidateSettings()
{

@ -64,6 +64,7 @@ static bool ClimateThresholdModeChanged(int32 p1);
static bool VelocityUnitsChanged(int32 p1);
static bool ChangeTrackTypeSortMode(int32 p1);
static bool PublicRoadsSettingChange(int32 p1);
static bool TrainSpeedAdaptionChanged(int32 p1);
static bool UpdateClientName(int32 p1);
static bool UpdateServerPassword(int32 p1);
@ -1687,6 +1688,7 @@ def = true
str = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION
strhelp = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION_HELPTEXT
cat = SC_EXPERT
proc = TrainSpeedAdaptionChanged
patxname = ""train_speed_adaption.vehicle.train_speed_adaption""
[SDT_BOOL]

Loading…
Cancel
Save