--- a/src/town_map.h Thu Nov 22 23:01:41 2007 +0000
+++ b/src/town_map.h Fri Nov 23 16:59:30 2007 +0000
@@ -77,7 +77,7 @@
*/
static inline bool LiftHasDestination(TileIndex t)
{
- return HASBIT(_me[t].m7, 0);
+ return HasBit(_me[t].m7, 0);
}
/**
@@ -88,7 +88,7 @@
*/
static inline void SetLiftDestination(TileIndex t, byte dest)
{
- SETBIT(_me[t].m7, 0);
+ SetBit(_me[t].m7, 0);
SB(_me[t].m7, 1, 3, dest);
}
@@ -166,7 +166,7 @@
static inline bool IsHouseCompleted(TileIndex t)
{
assert(IsTileType(t, MP_HOUSE));
- return HASBIT(_m[t].m3, 7);
+ return HasBit(_m[t].m3, 7);
}
/**
@@ -283,7 +283,7 @@
/* House is now completed.
* Store the year of construction as well, for newgrf house purpose */
SetHouseCompleted(t, true);
- _m[t].m5 = clamp(_cur_year - ORIGINAL_BASE_YEAR, 0, 0xFF);
+ _m[t].m5 = Clamp(_cur_year - ORIGINAL_BASE_YEAR, 0, 0xFF);
}
}
@@ -300,6 +300,19 @@
}
/**
+ * Set the random bits for this house.
+ * This is required for newgrf house
+ * @param t the tile of this house
+ * @param random the new random bits
+ * @pre IsTileType(t, MP_HOUSE)
+ */
+static inline void SetHouseRandomBits(TileIndex t, byte random)
+{
+ assert(IsTileType(t, MP_HOUSE));
+ _m[t].m1 = random;
+}
+
+/**
* Get the random bits for this house.
* This is required for newgrf house
* @param t the tile of this house