30 DEBUG(eco, 7, "Obtaining highest town radius for tile 0x%x", tile); |
30 DEBUG(eco, 7, "Obtaining highest town radius for tile 0x%x", tile); |
31 |
31 |
32 /* We do have a tile that directly belongs to a town */ |
32 /* We do have a tile that directly belongs to a town */ |
33 if (IsTileType(tile, MP_HOUSE) || |
33 if (IsTileType(tile, MP_HOUSE) || |
34 (IsTileType(tile, MP_STREET) && |
34 (IsTileType(tile, MP_STREET) && |
35 (IsLevelCrossing(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile)) == OWNER_TOWN)) { |
35 (GetTileOwner(tile)) == OWNER_TOWN)) { /** @todo check this for level crossings, trams, etc */ |
36 t = GetTownByTile(tile); |
36 t = GetTownByTile(tile); |
37 group = t->GetRadiusGroup(tile, true) + 1; |
37 group = t->GetRadiusGroup(tile, true) + 1; |
38 DEBUG(eco, 6, "Tile 0x%x belongs to town at 0x%x, level %d", tile, t->xy, group); |
38 DEBUG(eco, 6, "Tile 0x%x belongs to town at 0x%x, level %d", tile, t->xy, group); |
39 return t; |
39 return t; |
40 } |
40 } |