diff options
author | Patric Stout <truebrain@openttd.org> | 2021-06-12 14:49:51 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-06-15 16:45:04 +0200 |
commit | 97b94bdc9ab4ceeb589c5022d5c238442faf0454 (patch) | |
tree | 7d22a32f5bf2ac2a56467b7ce5f190fff9c8d09a /src/saveload/economy_sl.cpp | |
parent | f67af5cbe5cb754c3b64553b9cc03b5c18ca7e79 (diff) | |
download | openttd-97b94bdc9ab4ceeb589c5022d5c238442faf0454.tar.xz |
Change: prefix SL_ARR with the length of the array
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
Diffstat (limited to 'src/saveload/economy_sl.cpp')
-rw-r--r-- | src/saveload/economy_sl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/economy_sl.cpp b/src/saveload/economy_sl.cpp index b51151c14..82e3014ad 100644 --- a/src/saveload/economy_sl.cpp +++ b/src/saveload/economy_sl.cpp @@ -20,8 +20,8 @@ static void Load_PRIC() { /* Old games store 49 base prices, very old games store them as int32 */ int vt = IsSavegameVersionBefore(SLV_65) ? SLE_FILE_I32 : SLE_FILE_I64; - SlArray(nullptr, 49, vt | SLE_VAR_NULL); - SlArray(nullptr, 49, SLE_FILE_U16 | SLE_VAR_NULL); + SlCopy(nullptr, 49, vt | SLE_VAR_NULL); + SlCopy(nullptr, 49, SLE_FILE_U16 | SLE_VAR_NULL); } /** Cargo payment rates in pre 126 savegames */ @@ -29,8 +29,8 @@ static void Load_CAPR() { uint num_cargo = IsSavegameVersionBefore(SLV_55) ? 12 : IsSavegameVersionBefore(SLV_EXTEND_CARGOTYPES) ? 32 : NUM_CARGO; int vt = IsSavegameVersionBefore(SLV_65) ? SLE_FILE_I32 : SLE_FILE_I64; - SlArray(nullptr, num_cargo, vt | SLE_VAR_NULL); - SlArray(nullptr, num_cargo, SLE_FILE_U16 | SLE_VAR_NULL); + SlCopy(nullptr, num_cargo, vt | SLE_VAR_NULL); + SlCopy(nullptr, num_cargo, SLE_FILE_U16 | SLE_VAR_NULL); } static const SaveLoad _economy_desc[] = { |