summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-29 18:21:10 +0000
committeryexo <yexo@openttd.org>2010-01-29 18:21:10 +0000
commitf381b91de02e3a9a8df5ea83305a1cce52edab68 (patch)
treec09e5150e96ef170dde8bd638042b07f643fc7ac
parentf8b0ddd3eca33be188b90b62c13cecd2c0c18783 (diff)
downloadopenttd-f381b91de02e3a9a8df5ea83305a1cce52edab68.tar.xz
(svn r18950) -Fix: make sure the values of settings loaded from a savegame are valid
-rw-r--r--bin/ai/regression/regression.txt18
-rw-r--r--src/settings.cpp1
2 files changed, 10 insertions, 9 deletions
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index 6dd6b1e09..ab547d3b3 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -584,7 +584,7 @@
GetBankBalance(): 100000
GetName(): (null : 0x00000000)
GetLoanAmount(): 100000
- GetMaxLoanAmount(): 2000000000
+ GetMaxLoanAmount(): 500000
GetLoanInterval(): 10000
SetLoanAmount(1): false
SetLoanAmount(100): false
@@ -596,8 +596,8 @@
GetBankBalance(): 40000
GetLoanAmount(): 40000
SetLoanAmount(10000): true
- GetBankBalance(): 2000000000
- GetLoanAmount(): 2000000000
+ GetBankBalance(): 500000
+ GetLoanAmount(): 500000
GetCompanyHQ(): -1
BuildCompanyHQ(): true
GetCompanyHQ(): 33151
@@ -681,7 +681,7 @@
GetAirportWidth(9): -1
GetAirportHeight(9): -1
GetAirportCoverageRadius(9): -1
- GetBankBalance(): 1999999790
+ GetBankBalance(): 499790
GetPrice(): 5400
BuildAirport(): true
IsHangarTile(): false
@@ -691,11 +691,11 @@
IsHangarTile(): true
IsAirportTile(): true
GetAirportType(): 0
- GetBankBalance(): 1999989890
+ GetBankBalance(): 489890
RemoveAirport(): true
IsHangarTile(): false
IsAirportTile(): false
- GetBankBalance(): 1999989626
+ GetBankBalance(): 489626
BuildAirport(): true
--Bridge--
@@ -7085,7 +7085,7 @@
IsBuoyTile(): false
IsLockTile(): false
IsCanalTile(): false
- GetBankBalance(): 1999980703
+ GetBankBalance(): 480703
BuildWaterDepot(): true
BuildDock(): true
BuildBuoy(): true
@@ -7098,7 +7098,7 @@
IsBuoyTile(): true
IsLockTile(): true
IsCanalTile(): true
- GetBankBalance(): 1999951154
+ GetBankBalance(): 451154
--AIWaypointList(BUOY)--
Count(): 1
@@ -7117,7 +7117,7 @@
IsBuoyTile(): false
IsLockTile(): false
IsCanalTile(): false
- GetBankBalance(): 1999928509
+ GetBankBalance(): 428509
BuildWaterDepot(): true
BuildDock(): true
diff --git a/src/settings.cpp b/src/settings.cpp
index ccc3c5c85..3150ebc17 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1784,6 +1784,7 @@ static void LoadSettings(const SettingDesc *osd, void *object)
void *ptr = GetVariableAddress(object, sld);
if (!SlObjectMember(ptr, sld)) continue;
+ Write_ValidateSetting(ptr, osd, ReadValue(ptr, sld->conv));
}
}