summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-06-03 11:39:15 +0000
committersmatz <smatz@openttd.org>2008-06-03 11:39:15 +0000
commit7ec0a9ec3fb10beedebd553fbb8773a7bfffeaed (patch)
treefa51cf6da719adf06c4515730d8844e0989ae87a /src
parent722f48a1d6820a13af080ee351fa243d75b38f5c (diff)
downloadopenttd-7ec0a9ec3fb10beedebd553fbb8773a7bfffeaed.tar.xz
(svn r13373) -Fix (r10210): loading of very old savegames was broken
Diffstat (limited to 'src')
-rw-r--r--src/saveload.cpp12
-rw-r--r--src/subsidy_gui.cpp4
2 files changed, 12 insertions, 4 deletions
diff --git a/src/saveload.cpp b/src/saveload.cpp
index 9d734a835..76feecc38 100644
--- a/src/saveload.cpp
+++ b/src/saveload.cpp
@@ -651,10 +651,18 @@ void SlArray(void *array, size_t length, VarType conv)
/* NOTICE - handle some buggy stuff, in really old versions everything was saved
* as a byte-type. So detect this, and adjust array size accordingly */
if (!_sl.save && _sl_version == 0) {
+ /* all arrays except difficulty settings */
if (conv == SLE_INT16 || conv == SLE_UINT16 || conv == SLE_STRINGID ||
conv == SLE_INT32 || conv == SLE_UINT32) {
- length *= SlCalcConvFileLen(conv);
- conv = SLE_INT8;
+ SlCopyBytes(array, length * SlCalcConvFileLen(conv));
+ return;
+ }
+ /* used for conversion of Money 32bit->64bit */
+ if (conv == (SLE_FILE_I32 | SLE_VAR_I64)) {
+ for (uint i = 0; i < length; i++) {
+ ((int64*)array)[i] = (int32)BSWAP32(SlReadUint32());
+ }
+ return;
}
}
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 76cbf58b4..cebd0c595 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -46,11 +46,11 @@ struct SubsidyListWindow : Window {
}
if (num == 0) {
- y -= 10; /* "None" */
+ y -= 10; // "None"
if (y < 0) return;
}
- y -= 11; /* "Services already subsidised:" */
+ y -= 11; // "Services already subsidised:"
if (y < 0) return;
for (const Subsidy *s = _subsidies; s != endof(_subsidies); s++) {