# HG changeset patch # User frosch # Date 1313529933 0 # Node ID cbab0403699ac02c5b66d7ef7da2828b203e5b7d # Parent 5c138ff2133ffbc311260781ade1c26ac71e2043 (svn r22755) -Fix [FS#4727]: When marking tile selections dirty, use the height information of the corners instead of the surface slope. This is more accurate when the foundation is kind of undefined. diff --git a/src/viewport.cpp b/src/viewport.cpp --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1723,8 +1723,13 @@ int bot_y = top_y; do { - Point top = RemapCoords2(top_x, top_y); // topmost dirty point - Point bot = RemapCoords2(bot_x + TILE_SIZE - 1, bot_y + TILE_SIZE - 1); // bottommost point + /* topmost dirty point */ + TileIndex top_tile = TileVirtXY(top_x, top_y); + Point top = RemapCoords(top_x, top_y, GetTileMaxZ(top_tile)); + + /* bottommost point */ + TileIndex bottom_tile = TileVirtXY(bot_x, bot_y); + Point bot = RemapCoords(bot_x + TILE_SIZE, bot_y + TILE_SIZE, GetTileZ(bottom_tile)); // bottommost point /* the 'x' coordinate of 'top' and 'bot' is the same (and always in the same distance from tile middle), * tile height/slope affects only the 'y' on-screen coordinate! */