mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-26 16:09:10 +00:00
(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.
This commit is contained in:
5
tile.h
5
tile.h
@@ -89,6 +89,11 @@ static inline TileType GetTileType(TileIndex tile)
|
|||||||
static inline void SetTileType(TileIndex tile, TileType type)
|
static inline void SetTileType(TileIndex tile, TileType type)
|
||||||
{
|
{
|
||||||
assert(tile < MapSize());
|
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);
|
SB(_m[tile].type_height, 4, 4, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user