summaryrefslogtreecommitdiff
path: root/src/industry_map.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-03-08 16:10:39 +0000
committersmatz <smatz@openttd.org>2009-03-08 16:10:39 +0000
commite124aa8fd62f3260d2a127aab1e9bc6f5a303480 (patch)
tree093e5d2cab6ed85f891e85bb8d9947464dbc8706 /src/industry_map.h
parent7c8474da13d295ddb6224fe66c41e4ba4ac0f050 (diff)
downloadopenttd-e124aa8fd62f3260d2a127aab1e9bc6f5a303480.tar.xz
(svn r15643) -Fix [FS#2711]: be more strict with zeroing unused map array bits
Diffstat (limited to 'src/industry_map.h')
-rw-r--r--src/industry_map.h39
1 files changed, 20 insertions, 19 deletions
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
@@ -166,25 +166,6 @@ static inline bool IsIndustryTileOnWater(TileIndex t)
}
/**
- * 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
* @pre IsTileType(tile, MP_INDUSTRY)
@@ -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 */