diff options
author | tron <tron@openttd.org> | 2006-06-08 18:31:54 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-08 18:31:54 +0000 |
commit | 7c1f1d823f059e3e8c8a336b6acb819c0ee5a03c (patch) | |
tree | 1721f3f0ea1d8ad323751b7106f968c10d52a3b2 /town_map.h | |
parent | b690e85604ce3f024dab32bf19a23afe992090e7 (diff) | |
download | openttd-7c1f1d823f059e3e8c8a336b6acb819c0ee5a03c.tar.xz |
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
Diffstat (limited to 'town_map.h')
-rw-r--r-- | town_map.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/town_map.h b/town_map.h index 88148152c..bc546cd10 100644 --- a/town_map.h +++ b/town_map.h @@ -20,14 +20,13 @@ static inline TownID GetTownIndex(TileIndex t) } /** - * Set the town index for a street tile. + * Set the town index for a road or house tile. * @param tile the tile * @param index the index of the town - * @pre IsTileType(tile, MP_STREET) */ static inline void SetTownIndex(TileIndex t, TownID index) { - assert(IsTileType(t, MP_STREET)); + assert(IsTileType(t, MP_STREET) || IsTileType(t, MP_HOUSE)); _m[t].m2 = index; } @@ -81,6 +80,10 @@ static inline Town* GetTownByTile(TileIndex t) return GetTown(GetTownIndex(t)); } + +Town* CalcClosestTownFromTile(TileIndex tile, uint threshold); + + static inline void MakeHouseTile(TileIndex t, TownID tid, byte counter, byte stage, byte type) { assert(IsTileType(t, MP_CLEAR)); |