diff options
author | tron <tron@openttd.org> | 2006-03-30 09:29:01 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-30 09:29:01 +0000 |
commit | 7ad0d787e25306e700045cb678c66eeba9ea4434 (patch) | |
tree | 21b00e82b5c9850aa9567dba92d59ebb57aa50ba /industry_map.h | |
parent | 84de6477b2665dd0b16f93b677501dde02fc40d5 (diff) | |
download | openttd-7ad0d787e25306e700045cb678c66eeba9ea4434.tar.xz |
(svn r4166) Sprinkle several map accessors with assert()s
Diffstat (limited to 'industry_map.h')
-rw-r--r-- | industry_map.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/industry_map.h b/industry_map.h index f42d11833..3726b619c 100644 --- a/industry_map.h +++ b/industry_map.h @@ -7,6 +7,7 @@ static inline uint GetIndustryIndex(TileIndex t) { + assert(IsTileType(t, MP_INDUSTRY)); return _m[t].m2; } @@ -16,19 +17,22 @@ static inline Industry* GetIndustryByTile(TileIndex t) } -static inline bool IsIndustryCompleted(TileIndex tile) +static inline bool IsIndustryCompleted(TileIndex t) { - return HASBIT(_m[tile].m1, 7); + assert(IsTileType(t, MP_INDUSTRY)); + return HASBIT(_m[t].m1, 7); } static inline uint GetIndustryGfx(TileIndex t) { + assert(IsTileType(t, MP_INDUSTRY)); return _m[t].m5; } static inline void SetIndustryGfx(TileIndex t, uint gfx) { + assert(IsTileType(t, MP_INDUSTRY)); _m[t].m5 = gfx; } |