@@ -756,13 +756,13 @@ static bool IsNeighborRoadTile(TileIndex
* for each uneven value the left TileIndexDiff
* for each with 2nd bit set (2,3,6,7,..) add the reversed TileIndexDiff */
cur += tid_lt[(pos & 1) ? 0 : 1];
if (pos & 2) cur += tid_lt[2];
cur = (uint)(pos / 4) * cur; // Multiply for the fitting distance
if (GetTownRoadBits(TILE_ADD(tile, cur)) & DiagDirToRoadBits((pos & 2) ? dir : ReverseDiagDir(dir))) return true;
if (IsValidTile(tile + TileXY(TileX(cur) / 2, TileY(cur) / 2)) && IsValidTile(tile + cur) && GetTownRoadBits(TILE_ADD(tile, cur)) & DiagDirToRoadBits((pos & 2) ? dir : ReverseDiagDir(dir))) return true;
}
return false;
/**
* Check if a Road is allowed on a given tile
@@ -1132,12 +1132,14 @@ static void GrowTownInTile(TileIndex *ti
/* This is the tile we will reach if we extend to this direction. */
TileIndex house_tile = TileAddByDiagDir(tile, target_dir); // position of a possible house
/* Don't walk into water. */
if (IsWaterTile(house_tile)) return;
if (!IsValidTile(house_tile) || !IsValidTile(house_tile + TileOffsByDiagDir(target_dir))) return;
switch (t1->GetActiveLayout()) {
default: NOT_REACHED();
case TL_NO_ROADS:
allow_house = true;
break;