Mercurial > hg > openttd
changeset 11953:a299a5b5a555 draft
(svn r16357) -Codechange: delete invalid depots in TTD savegames caused by improper SVXConverter conversions
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 19 May 2009 12:47:47 +0000 |
parents | 82e90bc0a1d9 |
children | 92364e306ac7 |
files | src/saveload/oldloader_sl.cpp |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -96,6 +96,17 @@ FixOldMapArray(); } +static void FixTTDDepots() +{ + const Depot *d; + FOR_ALL_DEPOTS_FROM(d, 252) { + if (!IsRoadDepotTile(d->xy) && !IsRailDepotTile(d->xy) && !IsShipDepotTile(d->xy) && !IsHangarTile(d->xy)) { + /** Workaround for SVXConverter bug, depots 252-255 could be invalid */ + delete d; + } + } +} + #define FIXNUM(x, y, z) (((((x) << 16) / (y)) + 1) << z) static uint32 RemapOldTownName(uint32 townnameparts, byte old_town_name_type) @@ -1769,6 +1780,7 @@ DEBUG(oldloader, 3, "Done, converting game data..."); FixTTDMapArray(); + FixTTDDepots(); /* Fix some general stuff */ _settings_game.game_creation.landscape = _settings_game.game_creation.landscape & 0xF;