(svn r4166) Sprinkle several map accessors with assert()s

This commit is contained in:
tron
2006-03-30 09:29:01 +00:00
parent 84de6477b2
commit 7ad0d787e2
9 changed files with 230 additions and 53 deletions

View File

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