summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-03-20 16:43:48 +0000
committercelestar <celestar@openttd.org>2006-03-20 16:43:48 +0000
commitb5b348bdcee54a6220c7a9bad7c65464bc70c385 (patch)
treecc5045ef1db49cd6bee44904b6462f9adfd8fd86 /viewport.c
parentf91b027bea3af341ec2713c30b85526a56725561 (diff)
downloadopenttd-b5b348bdcee54a6220c7a9bad7c65464bc70c385.tar.xz
(svn r3992) -Fix: Rewrote the code to determine whether a rail-tile can be terraformed.
Fixes a bug where you could terraform a tunnel (fixed by r3228, but reverted that one) Fixes a bug introduced by r3228 which allowed steep rail tiles resulting in ... unwanted effects such as display artifacts. That means the terraform feature should not work as intended; it also uses _valid_tileh_slopes to determine valid configurations instead of hand-brewn stuff. TODO: _terraform_err_tile and similar TileIndices should have INVALID_TILE as "unused", not 0. (0 is a valid tile).
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/viewport.c b/viewport.c
index 7d88bb33a..c87e8e01f 100644
--- a/viewport.c
+++ b/viewport.c
@@ -634,7 +634,7 @@ static void DrawTileSelection(const TileInfo *ti)
#endif
// Draw a red error square?
- if (_thd.redsq != 0 && _thd.redsq == ti->tile) {
+ if (_thd.redsq != INVALID_TILE && _thd.redsq == ti->tile) {
DrawSelectionSprite(PALETTE_TILE_RED_PULSATING | (SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh]), ti);
return;
}
@@ -1812,8 +1812,8 @@ void SetRedErrorSquare(TileIndex tile)
_thd.redsq = tile;
if (tile != old) {
- if (tile != 0) MarkTileDirtyByTile(tile);
- if (old != 0) MarkTileDirtyByTile(old);
+ if (tile != INVALID_TILE) MarkTileDirtyByTile(tile);
+ if (old != INVALID_TILE) MarkTileDirtyByTile(old);
}
}