summaryrefslogtreecommitdiff
path: root/ttd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-26 18:17:50 +0000
committertron <tron@openttd.org>2005-01-26 18:17:50 +0000
commita2971d0449571b8669d61f742ffdc2bef57a4992 (patch)
tree67b4371b9a0d611d7856026852796bb0e9cee35c /ttd.c
parent478e001d0e842eb0a3822b821dd34d7adbe4aeee (diff)
downloadopenttd-a2971d0449571b8669d61f742ffdc2bef57a4992.tar.xz
(svn r1683) Fix placement of MP_VOID tiles. On square maps it accidently works, but on non-square maps the wrong tiles would get marked as MP_VOID
Diffstat (limited to 'ttd.c')
-rw-r--r--ttd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ttd.c b/ttd.c
index f86c00e27..20c7798cd 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1258,15 +1258,17 @@ static void UpdateCurrencies(void)
_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
+/* 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
+ */
static void UpdateVoidTiles(void)
{
uint 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());
+
+ for (i = 0; i < MapMaxY(); ++i)
+ SetTileType(i * MapSizeX() + MapMaxX(), MP_VOID);
+ for (i = 0; i < MapSizeX(); ++i)
+ SetTileType(MapSizeX() * MapMaxY() + i, MP_VOID);
}
// since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255)