(svn r1584) Fix: Highlighlighting tiles under bridges works again correctly for square selection tools.
authordominik
Sat, 22 Jan 2005 09:17:58 +0000
changeset 1083 2e9d525af38d
parent 1082 56a4c048c5c3
child 1084 16db2b52597e
(svn r1584) Fix: Highlighlighting tiles under bridges works again correctly for square selection tools.
viewport.c
--- a/viewport.c	Fri Jan 21 19:52:32 2005 +0000
+++ b/viewport.c	Sat Jan 22 09:17:58 2005 +0000
@@ -375,7 +375,7 @@
 		// 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 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)