From e57699d8c0eea4021e84e61e93455bdf47139dad Mon Sep 17 00:00:00 2001 From: smatz Date: Sun, 8 Mar 2009 16:10:39 +0000 Subject: (svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits --- src/industry_map.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/industry_map.h') diff --git a/src/industry_map.h b/src/industry_map.h index 158d0d92e..abfbfdf4a 100644 --- a/src/industry_map.h +++ b/src/industry_map.h @@ -165,25 +165,6 @@ static inline bool IsIndustryTileOnWater(TileIndex t) return (GetWaterClass(t) != WATER_CLASS_INVALID); } -/** - * Make the given tile an industry tile - * @param t the tile to make an industry tile - * @param index the industry this tile belongs to - * @param gfx the graphics to use for the tile - * @param random the random value - */ -static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc) -{ - SetTileType(t, MP_INDUSTRY); - _m[t].m1 = 0; - _m[t].m2 = index; - _m[t].m3 = 0; - _m[t].m4 = 0; - SetIndustryGfx(t, gfx); - _me[t].m7 = random; - SetWaterClass(t, wc); -} - /** * Returns this indutry tile's construction counter value * @param tile the tile to query @@ -321,4 +302,24 @@ static inline void SetIndustryTriggers(TileIndex tile, byte triggers) SB(_m[tile].m6, 3, 3, triggers); } +/** + * Make the given tile an industry tile + * @param t the tile to make an industry tile + * @param index the industry this tile belongs to + * @param gfx the graphics to use for the tile + * @param random the random value + */ +static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc) +{ + SetTileType(t, MP_INDUSTRY); + _m[t].m1 = 0; + _m[t].m2 = index; + _m[t].m3 = 0; + _m[t].m4 = 0; + SetIndustryGfx(t, gfx); // m5, part of m6 + SetIndustryTriggers(t, 0); // rest of m6 + SetIndustryRandomBits(t, random); // m7 + SetWaterClass(t, wc); +} + #endif /* INDUSTRY_MAP_H */ -- cgit v1.2.3-54-g00ecf