summaryrefslogtreecommitdiff
path: root/town_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-08 18:31:54 +0000
committertron <tron@openttd.org>2006-06-08 18:31:54 +0000
commit047ee8a601025159b7fdf1d5d8a76e5cf361611b (patch)
tree1721f3f0ea1d8ad323751b7106f968c10d52a3b2 /town_map.h
parentf2da689343942afda5d5f53468d6cba25c86811d (diff)
downloadopenttd-047ee8a601025159b7fdf1d5d8a76e5cf361611b.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.h9
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));