summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2006-01-28 09:45:25 +0000
committermatthijs <matthijs@openttd.org>2006-01-28 09:45:25 +0000
commit7428b4503f75d7e81a1046bd15f33d4b5c24bc78 (patch)
treed65da859843c5bb80748baa50ea74675d1c7cb8d /tile.h
parent524f8b7f271fa1c25523727a1f788bfb9da6fab4 (diff)
downloadopenttd-7428b4503f75d7e81a1046bd15f33d4b5c24bc78.tar.xz
(svn r3455) * Assert against modifying the outer border of a map into anything but MP_VOID. This might detect a bug that has been there for quite some time, if it hasn't been fixed already.
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tile.h b/tile.h
index c12bf974e..e02c9e443 100644
--- a/tile.h
+++ b/tile.h
@@ -89,6 +89,11 @@ static inline TileType GetTileType(TileIndex tile)
static inline void SetTileType(TileIndex tile, TileType type)
{
assert(tile < MapSize());
+ /* Allow only MP_VOID to be set to border tiles. This code is put here since
+ * it seems there is a bug that violates this somewhere. (Formely know as
+ * the "old ship pf" bug, which presented a case in which this broke). It
+ * can be removed as soon as the bug is squashed. */
+ assert((TileX(tile) < MapMaxX() && TileY(tile) < MapMaxY()) || type == MP_VOID);
SB(_m[tile].type_height, 4, 4, type);
}