Clear state when setting changed
This commit is contained in:
@@ -1541,6 +1541,15 @@ static bool PublicRoadsSettingChange(int32 p1) {
|
|||||||
return true;
|
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. */
|
/** Checks if any settings are set to incorrect values, and sets them to correct values in that case. */
|
||||||
static void ValidateSettings()
|
static void ValidateSettings()
|
||||||
{
|
{
|
||||||
|
@@ -64,6 +64,7 @@ static bool ClimateThresholdModeChanged(int32 p1);
|
|||||||
static bool VelocityUnitsChanged(int32 p1);
|
static bool VelocityUnitsChanged(int32 p1);
|
||||||
static bool ChangeTrackTypeSortMode(int32 p1);
|
static bool ChangeTrackTypeSortMode(int32 p1);
|
||||||
static bool PublicRoadsSettingChange(int32 p1);
|
static bool PublicRoadsSettingChange(int32 p1);
|
||||||
|
static bool TrainSpeedAdaptionChanged(int32 p1);
|
||||||
|
|
||||||
static bool UpdateClientName(int32 p1);
|
static bool UpdateClientName(int32 p1);
|
||||||
static bool UpdateServerPassword(int32 p1);
|
static bool UpdateServerPassword(int32 p1);
|
||||||
@@ -1687,6 +1688,7 @@ def = true
|
|||||||
str = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION
|
str = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION
|
||||||
strhelp = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION_HELPTEXT
|
strhelp = STR_CONFIG_SETTING_TRAIN_SPEED_ADAPTION_HELPTEXT
|
||||||
cat = SC_EXPERT
|
cat = SC_EXPERT
|
||||||
|
proc = TrainSpeedAdaptionChanged
|
||||||
patxname = ""train_speed_adaption.vehicle.train_speed_adaption""
|
patxname = ""train_speed_adaption.vehicle.train_speed_adaption""
|
||||||
|
|
||||||
[SDT_BOOL]
|
[SDT_BOOL]
|
||||||
|
Reference in New Issue
Block a user