YAPF: Prevent user for configuring signal penalties to negative values

Warn if signal penalty polynomial goes negative, and clamp to non-negative
This commit is contained in:
Jonathan G Rennison
2020-01-17 19:23:03 +00:00
parent 07f5b86dfc
commit bb363695fc
5 changed files with 34 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ static bool ImprovedBreakdownsSettingChanged(int32 p1);
static bool DayLengthChanged(int32 p1);
static bool SimulatedWormholeSignalsChanged(int32 p1);
static bool EnableSingleVehSharedOrderGuiChanged(int32 p1);
static bool CheckYapfRailSignalPenalties(int32 p1);
static bool UpdateClientName(int32 p1);
static bool UpdateServerPassword(int32 p1);
@@ -3078,6 +3079,7 @@ def = 10
min = 1
max = 100
cat = SC_EXPERT
proc = CheckYapfRailSignalPenalties
[SDT_VAR]
base = GameSettings
@@ -3088,6 +3090,7 @@ def = 500
min = -1000000
max = 1000000
cat = SC_EXPERT
proc = CheckYapfRailSignalPenalties
[SDT_VAR]
base = GameSettings
@@ -3098,6 +3101,7 @@ def = -100
min = -1000000
max = 1000000
cat = SC_EXPERT
proc = CheckYapfRailSignalPenalties
[SDT_VAR]
base = GameSettings
@@ -3108,6 +3112,7 @@ def = 5
min = -1000000
max = 1000000
cat = SC_EXPERT
proc = CheckYapfRailSignalPenalties
[SDT_VAR]
base = GameSettings