summaryrefslogtreecommitdiff
path: root/src/object_map.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-27 22:26:21 +0000
committerrubidium <rubidium@openttd.org>2010-08-27 22:26:21 +0000
commit536bb704b7bd4d15302e6e2f0200184af151cb73 (patch)
tree4e59ca5a88842082b129dffae41b33cf3670d15e /src/object_map.h
parent3e9e1b8e659c7fe36ac2188fb86ac601a8210d50 (diff)
downloadopenttd-536bb704b7bd4d15302e6e2f0200184af151cb73.tar.xz
(svn r20639) -Add: random bits to object tiles
Diffstat (limited to 'src/object_map.h')
-rw-r--r--src/object_map.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/object_map.h b/src/object_map.h
index e08e36ee6..580fd6976 100644
--- a/src/object_map.h
+++ b/src/object_map.h
@@ -105,6 +105,18 @@ static inline bool IsStatueTile(TileIndex t)
return IsTileType(t, MP_OBJECT) && IsStatue(t);
}
+/**
+ * Get the random bits of this tile.
+ * @param t The tile to get the bits for.
+ * @pre IsTileType(t, MP_OBJECT)
+ * @return The random bits.
+ */
+static inline byte GetObjectRandomBits(TileIndex t)
+{
+ assert(IsTileType(t, MP_OBJECT));
+ return _m[t].m3;
+}
+
/**
* Make an Object tile.
@@ -114,14 +126,15 @@ static inline bool IsStatueTile(TileIndex t)
* @param o The new owner of the tile.
* @param index Index to the object.
* @param wc Water class for this obect.
+ * @param random Random data to store on the tile
*/
-static inline void MakeObject(TileIndex t, ObjectType u, Owner o, ObjectID index, WaterClass wc)
+static inline void MakeObject(TileIndex t, ObjectType u, Owner o, ObjectID index, WaterClass wc, byte random)
{
SetTileType(t, MP_OBJECT);
SetTileOwner(t, o);
SetWaterClass(t, wc);
_m[t].m2 = index;
- _m[t].m3 = 0;
+ _m[t].m3 = random;
_m[t].m4 = 0;
_m[t].m5 = u;
SB(_m[t].m6, 2, 4, 0);