(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

This commit is contained in:
tron
2006-06-08 18:31:54 +00:00
parent f2da689343
commit 047ee8a601
3 changed files with 37 additions and 26 deletions

View File

@@ -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));