diff options
author | tron <tron@openttd.org> | 2006-03-24 12:00:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-24 12:00:24 +0000 |
commit | 88d27219b47c9398e9aec354ec0bd59ae9912486 (patch) | |
tree | a82b65f2906613e4cab8c42090a411b44dbd6b00 /town_map.h | |
parent | bb27e9abb34c48a39df3091ed55cce87be291720 (diff) | |
download | openttd-88d27219b47c9398e9aec354ec0bd59ae9912486.tar.xz |
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
Diffstat (limited to 'town_map.h')
-rw-r--r-- | town_map.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/town_map.h b/town_map.h new file mode 100644 index 000000000..364d0047f --- /dev/null +++ b/town_map.h @@ -0,0 +1,14 @@ +/* $Id$ */ + +#include "town.h" + + +static inline uint GetTownIndex(TileIndex t) +{ + return _m[t].m2; +} + +static inline Town* GetTownByTile(TileIndex t) +{ + return GetTown(GetTownIndex(t)); +} |