summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-17 10:35:13 +0000
committerrubidium <rubidium@openttd.org>2009-05-17 10:35:13 +0000
commitf457cff73c08b3d338d9a601e84b18aba66e2a64 (patch)
tree126b97f8660ce42f4c357b8ec271798c2a40a0d5 /src/saveload
parent6b2f9e8c9edd6a8e5528898db0bbdb884b0221a2 (diff)
downloadopenttd-f457cff73c08b3d338d9a601e84b18aba66e2a64.tar.xz
(svn r16329) -Fix: possible desync when removing lots of towns in-game (not that we allow removing towns now, but better not have desync prone code lingering around)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/misc_sl.cpp6
-rw-r--r--src/saveload/oldloader_sl.cpp8
-rw-r--r--src/saveload/town_sl.cpp5
3 files changed, 4 insertions, 15 deletions
diff --git a/src/saveload/misc_sl.cpp b/src/saveload/misc_sl.cpp
index 088c1b26e..7766ae505 100644
--- a/src/saveload/misc_sl.cpp
+++ b/src/saveload/misc_sl.cpp
@@ -68,14 +68,14 @@ static const SaveLoadGlobVarList _date_desc[] = {
SLE_CONDNULL(2, 0, 119),
SLEG_VAR(_random.state[0], SLE_UINT32),
SLEG_VAR(_random.state[1], SLE_UINT32),
- SLEG_CONDVAR(_cur_town_ctr, SLE_FILE_U8 | SLE_VAR_U32, 0, 9),
- SLEG_CONDVAR(_cur_town_ctr, SLE_UINT32, 10, SL_MAX_VERSION),
+ SLE_CONDNULL(1, 0, 9),
+ SLE_CONDNULL(4, 10, 119),
SLEG_VAR(_cur_company_tick_index, SLE_FILE_U8 | SLE_VAR_U32),
SLEG_CONDVAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32, 0, 108),
SLEG_CONDVAR(_next_competitor_start, SLE_UINT32, 109, SL_MAX_VERSION),
SLEG_VAR(_trees_tick_ctr, SLE_UINT8),
SLEG_CONDVAR(_pause_mode, SLE_UINT8, 4, SL_MAX_VERSION),
- SLEG_CONDVAR(_cur_town_iter, SLE_UINT32, 11, SL_MAX_VERSION),
+ SLE_CONDNULL(4, 10, 119),
SLEG_END()
};
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index 787adde34..a0764d408 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -1583,7 +1583,6 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
}
extern TileIndex _cur_tileloop_tile;
-static uint32 _old_cur_town_ctr;
static const OldChunks main_chunk[] = {
OCL_ASSERT( OC_TTD, 0 ),
OCL_ASSERT( OC_TTO, 0 ),
@@ -1618,7 +1617,7 @@ static const OldChunks main_chunk[] = {
OCL_ASSERT( OC_TTD, 0x4B26 ),
OCL_ASSERT( OC_TTO, 0x3A20 ),
- OCL_VAR ( OC_UINT32, 1, &_old_cur_town_ctr ),
+ OCL_NULL( 4 ), ///< town counter, no longer in use
OCL_NULL( 2 ), ///< timer_counter, no longer in use
OCL_NULL( 2 ), ///< land_code, no longer in use
@@ -1774,9 +1773,6 @@ bool LoadTTDMain(LoadgameState *ls)
/* Fix some general stuff */
_settings_game.game_creation.landscape = _settings_game.game_creation.landscape & 0xF;
- /* Remap some pointers */
- _cur_town_ctr = RemapTownIndex(_old_cur_town_ctr);
-
/* Fix the game to be compatible with OpenTTD */
FixOldTowns();
FixOldVehicles();
@@ -1813,8 +1809,6 @@ bool LoadTTOMain(LoadgameState *ls)
_settings_game.game_creation.landscape = 0;
_trees_tick_ctr = 0xFF;
- _cur_town_ctr = RemapTownIndex(_old_cur_town_ctr);
-
if (!FixTTOMapArray() || !FixTTOEngines()) {
DEBUG(oldloader, 0, "Conversion failed");
return false;
diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp
index 2b25356a7..c28f6acac 100644
--- a/src/saveload/town_sl.cpp
+++ b/src/saveload/town_sl.cpp
@@ -189,11 +189,6 @@ static void Load_TOWN()
_total_towns++;
}
-
- /* This is to ensure all pointers are within the limits of
- * the size of the TownPool */
- if (_cur_town_ctr > GetMaxTownIndex())
- _cur_town_ctr = 0;
}
extern const ChunkHandler _town_chunk_handlers[] = {