summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-22 09:17:58 +0000
committerdominik <dominik@openttd.org>2005-01-22 09:17:58 +0000
commit3b0892d1d88fdd06fc4cf4f1a9593d0bc6ba36dc (patch)
treec0180253fa4441c5d8c03dd7706f7a09c10ee4b0
parent0d43eb3ab8a1e42f53772480eb94493b97177a8e (diff)
downloadopenttd-3b0892d1d88fdd06fc4cf4f1a9593d0bc6ba36dc.tar.xz
(svn r1584) Fix: Highlighlighting tiles under bridges works again correctly for square selection tools.
-rw-r--r--viewport.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/viewport.c b/viewport.c
index f1f99067b..96f84e598 100644
--- a/viewport.c
+++ b/viewport.c
@@ -375,7 +375,7 @@ void DrawGroundSprite(uint32 image)
// offset ground sprite because of foundation?
AddChildSpriteScreen(image, _cur_vd->offs_x, _cur_vd->offs_y);
} else {
- _added_tile_sprite = true;
+ _added_tile_sprite = true;
DrawGroundSpriteAt(image, _cur_ti->x, _cur_ti->y, _cur_ti->z);
}
}
@@ -595,7 +595,11 @@ static int dbg_draw_pushed(const TileInfo *ti)
static void DrawSelectionSprite(uint32 image, const TileInfo *ti)
{
- AddSortableSpriteToDraw(image, ti->x, ti->y, 0x10, 0x10, 1, ti->z + 7);
+ if (_added_tile_sprite && !(_thd_ptr->drawstyle & HT_LINE)) { // draw on real ground
+ DrawGroundSpriteAt(image, ti->x, ti->y, ti->z + 7);
+ } else { // draw on top of foundation
+ AddSortableSpriteToDraw(image, ti->x, ti->y, 0x10, 0x10, 1, ti->z + 7);
+ }
}
static bool IsPartOfAutoLine(int px, int py)