summaryrefslogtreecommitdiff
path: root/ttd.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-07 18:13:56 +0000
committerdominik <dominik@openttd.org>2005-01-07 18:13:56 +0000
commitb78b576b214512a66dde9b59eea141824d162690 (patch)
treec2ea4c7f8309652af139c755c3fbc7282d37a645 /ttd.c
parent76c7f3b14e159539e512ac6f13019eea0bad1a04 (diff)
downloadopenttd-b78b576b214512a66dde9b59eea141824d162690.tar.xz
(svn r1417) Fix: The invisible tiles on the southern border are now converted to class MP_VOID when an old map (with wrong classified invisible tiles) is loaded.
I bumped the minor savegame version for that, even though it's not really necessary. We're not gonna run out of minor savegame versions anyway though. ;)
Diffstat (limited to 'ttd.c')
-rw-r--r--ttd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ttd.c b/ttd.c
index 6822f1637..39b9a4f42 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1238,6 +1238,17 @@ void UpdateCurrencies()
_opt.currency = convert_currency[_opt.currency];
}
+// up to revision 1413, the invisible tiles at the southern border have not been MP_VOID
+// even though they should have. This is fixed by this function
+void UpdateVoidTiles()
+{
+ int i;
+ // create void tiles on the border
+ for (i = 0; i != MapMaxY(); i++)
+ _map_type_and_height[ i * MapSizeX() + MapMaxY() ] = MP_VOID << 4;
+ memset(_map_type_and_height + MapMaxY() * MapSizeX(), MP_VOID << 4, MapSizeX());
+}
+
extern void UpdateOldAircraft();
bool AfterLoadGame(uint version)
@@ -1328,6 +1339,10 @@ bool AfterLoadGame(uint version)
CheckIsPlayerActive();
}
+ // the void tiles on the southern border used to belong to a wrong class.
+ if (version <= 0x402)
+ UpdateVoidTiles();
+
// If Load Scenario / New (Scenario) Game is used,
// a player does not exist yet. So create one here.
// 1 exeption: network-games. Those can have 0 players
@@ -1341,7 +1356,6 @@ bool AfterLoadGame(uint version)
return true;
}
-
void DebugProc(int i)
{
switch(i) {