(svn r4166) Sprinkle several map accessors with assert()s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user