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

@@ -3795,6 +3795,9 @@ bool AfterLoadGame()
InvalidateVehicleTickCaches();
ClearVehicleTickCaches();
extern void YapfCheckRailSignalPenalties();
YapfCheckRailSignalPenalties();
/* Show this message last to avoid covering up an error message if we bail out part way */
switch (gcf_res) {
case GLC_COMPATIBLE: ShowErrorMessage(STR_NEWGRF_COMPATIBLE_LOAD_WARNING, INVALID_STRING_ID, WL_CRITICAL); break;