summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordP <dp@dpointer.org>2020-06-28 19:04:55 +0300
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-06-28 18:23:59 +0200
commitca2604c4e2cc972c2081db91a5e7b0bcdd092203 (patch)
tree6e2300ca29c35ab4bc4b666469e193bf55d88fef /src
parent6d3c2edc599c3f74cf1aa3e69ddb6d301af62fa0 (diff)
downloadopenttd-ca2604c4e2cc972c2081db91a5e7b0bcdd092203.tar.xz
Revert #8157: Redundant change
Diffstat (limited to 'src')
-rw-r--r--src/saveload/afterload.cpp2
-rw-r--r--src/saveload/saveload.h1
-rw-r--r--src/saveload/town_sl.cpp27
3 files changed, 11 insertions, 19 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index e9c1cdb90..cc2a671a2 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2830,7 +2830,7 @@ bool AfterLoadGame()
* which is done by StartupEngines(). */
if (gcf_res != GLC_ALL_GOOD) StartupEngines();
- if (IsSavegameVersionBefore(SLV_FIX_TOWN_ACCEPTANCE)) {
+ if (IsSavegameVersionBefore(SLV_166)) {
/* Update cargo acceptance map of towns. */
for (TileIndex t = 0; t < map_size; t++) {
if (!IsTileType(t, MP_HOUSE)) continue;
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index dcf8a41d8..26462cdaa 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -302,7 +302,6 @@ enum SaveLoadVersion : uint16 {
SLV_MULTITILE_DOCKS, ///< 216 PR#7380 Multiple docks per station.
SLV_TRADING_AGE, ///< 217 PR#7780 Configurable company trading age.
SLV_ENDING_YEAR, ///< 218 PR#7747 v1.10 Configurable ending year.
- SLV_FIX_TOWN_ACCEPTANCE, ///< 219 PR#8157 Fix Town::cargo_accepted savegame format.
SL_MAX_VERSION, ///< Highest possible saveload version
};
diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp
index 7e41ef6cc..cbf7205d0 100644
--- a/src/saveload/town_sl.cpp
+++ b/src/saveload/town_sl.cpp
@@ -256,7 +256,7 @@ static void RealSave_Town(Town *t)
SlObject(&t->cargo_accepted, GetTileMatrixDesc());
if (t->cargo_accepted.area.w != 0) {
uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
- SlArray(t->cargo_accepted.data, arr_len, SLE_UINT64);
+ SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
}
}
@@ -288,23 +288,16 @@ static void Load_TOWN()
SlErrorCorrupt("Invalid town name generator");
}
- if (!IsSavegameVersionBefore(SLV_FIX_TOWN_ACCEPTANCE)) {
- SlObject(&t->cargo_accepted, GetTileMatrixDesc());
- if (t->cargo_accepted.area.w != 0) {
- uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
- t->cargo_accepted.data = MallocT<CargoTypes>(arr_len);
- SlArray(t->cargo_accepted.data, arr_len, SLE_UINT64);
+ if (IsSavegameVersionBefore(SLV_166)) continue;
- /* Rebuild total cargo acceptance. */
- UpdateTownCargoTotal(t);
- }
- } else if (!IsSavegameVersionBefore(SLV_166)) {
- AcceptanceMatrix cargo_accepted;
- SlObject(&cargo_accepted, GetTileMatrixDesc());
- if (cargo_accepted.area.w != 0) {
- uint arr_len = cargo_accepted.area.w / AcceptanceMatrix::GRID * cargo_accepted.area.h / AcceptanceMatrix::GRID;
- SlSkipBytes(4 * arr_len);
- }
+ SlObject(&t->cargo_accepted, GetTileMatrixDesc());
+ if (t->cargo_accepted.area.w != 0) {
+ uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
+ t->cargo_accepted.data = MallocT<CargoTypes>(arr_len);
+ SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
+
+ /* Rebuild total cargo acceptance. */
+ UpdateTownCargoTotal(t);
}
}
}