Changeset - r24716:ddd436699aee
[Not reviewed]
master
0 1 0
Tyler Trahan - 4 years ago 2021-01-31 09:04:22
tyler@tylertrahan.com
Fix: don't walk out of the map when trying to build tunnels (#8600)
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/town_cmd.cpp
Show inline comments
 
@@ -1256,6 +1256,7 @@ static bool GrowTownWithTunnel(const Tow
 
		/* Only tunnel under a mountain if the slope is continuous for at least 4 tiles. We want tunneling to be a last resort for large hills. */
 
		TileIndex slope_tile = tile;
 
		for (uint8 tiles = 0; tiles < 4; tiles++) {
 
			if (!IsValidTile(slope_tile)) return false;
 
			slope = GetTileSlope(slope_tile);
 
			if (slope != InclinedSlope(tunnel_dir) && !IsSteepSlope(slope) && !IsSlopeWithOneCornerRaised(slope)) return false;
 
			slope_tile += delta;
0 comments (0 inline, 0 general)