summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-10 16:24:42 +0000
committerrubidium <rubidium@openttd.org>2009-01-10 16:24:42 +0000
commit99337bf4a1f14325f2e5888569b8502d3064591c (patch)
tree87ac3a892b65e7cdaad514ffa194c37a25262211
parent0cd41d1dc62386d15960b5a6f990207caf8d9834 (diff)
downloadopenttd-99337bf4a1f14325f2e5888569b8502d3064591c.tar.xz
(svn r14959) -Fix [FS#2508]: wrong defaults for service interval when switching between service interval in days and service interval in percentages.
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/settings.cpp24
2 files changed, 10 insertions, 15 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 4c9b9b85e..502c54a16 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1224,7 +1224,6 @@ STR_CONFIG_PATCHES_INT32 :{NUM}
STR_CONFIG_PATCHES_CURRENCY :{CURRENCY}
STR_CONFIG_PATCHES_QUERY_CAPT :{WHITE}Change setting value
-STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE :{WHITE}Some or all of the default service interval(s) below are incompatible with the chosen setting! 5-90% and 30-800 days are valid
STR_CONFIG_PATCHES_PATHFINDER_FOR_TRAINS :{LTBLUE}Pathfinder for trains: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_PATHFINDER_FOR_TRAINS_NTP :NTP {RED}(Not recommended)
diff --git a/src/settings.cpp b/src/settings.cpp
index 3f52549ce..50e238ec7 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -902,24 +902,20 @@ static int32 UpdateConsists(int32 p1)
/* Check service intervals of vehicles, p1 is value of % or day based servicing */
static int32 CheckInterval(int32 p1)
{
- bool warning;
- const VehicleSettings *ptc = (_game_mode == GM_MENU) ? &_settings_newgame.vehicle : &_settings_game.vehicle;
+ VehicleSettings *ptc = (_game_mode == GM_MENU) ? &_settings_newgame.vehicle : &_settings_game.vehicle;
if (p1) {
- warning = ( (IsInsideMM(ptc->servint_trains, 5, 90 + 1) || ptc->servint_trains == 0) &&
- (IsInsideMM(ptc->servint_roadveh, 5, 90 + 1) || ptc->servint_roadveh == 0) &&
- (IsInsideMM(ptc->servint_aircraft, 5, 90 + 1) || ptc->servint_aircraft == 0) &&
- (IsInsideMM(ptc->servint_ships, 5, 90 + 1) || ptc->servint_ships == 0) );
+ ptc->servint_trains = 50;
+ ptc->servint_roadveh = 50;
+ ptc->servint_aircraft = 50;
+ ptc->servint_ships = 50;
} else {
- warning = ( (IsInsideMM(ptc->servint_trains, 30, 800 + 1) || ptc->servint_trains == 0) &&
- (IsInsideMM(ptc->servint_roadveh, 30, 800 + 1) || ptc->servint_roadveh == 0) &&
- (IsInsideMM(ptc->servint_aircraft, 30, 800 + 1) || ptc->servint_aircraft == 0) &&
- (IsInsideMM(ptc->servint_ships, 30, 800 + 1) || ptc->servint_ships == 0) );
+ ptc->servint_trains = 150;
+ ptc->servint_roadveh = 150;
+ ptc->servint_aircraft = 360;
+ ptc->servint_ships = 100;
}
- if (!warning)
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE, 0, 0);
-
return InValidateDetailsWindow(0);
}
@@ -1282,7 +1278,7 @@ const SettingDesc _patch_settings[] = {
SDT_VAR(GameSettings, vehicle.max_roadveh, SLE_UINT16, 0, 0, 500, 0, 5000, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, RedrawScreen),
SDT_VAR(GameSettings, vehicle.max_aircraft, SLE_UINT16, 0, 0, 200, 0, 5000, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT, RedrawScreen),
SDT_VAR(GameSettings, vehicle.max_ships, SLE_UINT16, 0, 0, 300, 0, 5000, 0, STR_CONFIG_PATCHES_MAX_SHIPS, RedrawScreen),
- SDT_BOOL(GameSettings, vehicle.servint_ispercent, 0, 0, false, STR_CONFIG_PATCHES_SERVINT_ISPERCENT, CheckInterval),
+ SDT_BOOL(GameSettings, vehicle.servint_ispercent, 0,NN, false, STR_CONFIG_PATCHES_SERVINT_ISPERCENT, CheckInterval),
SDT_VAR(GameSettings, vehicle.servint_trains, SLE_UINT16, 0,D0, 150, 5, 800, 0, STR_CONFIG_PATCHES_SERVINT_TRAINS, InValidateDetailsWindow),
SDT_VAR(GameSettings, vehicle.servint_roadveh, SLE_UINT16, 0,D0, 150, 5, 800, 0, STR_CONFIG_PATCHES_SERVINT_ROADVEH, InValidateDetailsWindow),
SDT_VAR(GameSettings, vehicle.servint_ships, SLE_UINT16, 0,D0, 360, 5, 800, 0, STR_CONFIG_PATCHES_SERVINT_SHIPS, InValidateDetailsWindow),