(svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits

This commit is contained in:
smatz
2009-03-08 16:10:39 +00:00
parent 7c8474da13
commit e124aa8fd6
10 changed files with 54 additions and 22 deletions

View File

@@ -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 */