206
203
_m[t].m5 = IsHouseCompleted(t) ? 0 : (stage << 3 | counter);
207
204
SetHouseAnimationFrame(t, 0);
208
205
_me[t].m7 = GetHouseSpecs(type)->processing_time;
210
if (GetHouseSpecs(type)->building_flags & BUILDING_IS_ANIMATED) AddAnimatedTile(t);
211
MarkTileDirtyByTile(t);
266
260
/* House is now completed.
267
261
* Store the year of construction as well, for newgrf house purpose */
268
262
SetHouseCompleted(t, true);
269
_m[t].m5 = Clamp(_cur_year - ORIGINAL_BASE_YEAR, 0, 0xFF);
274
* Get the year that this house was constructed (between 1920 and 2175).
267
* Sets the age of the house to zero.
268
* Needs to be called after the house is completed. During construction stages the map space is used otherwise.
269
* @param t the tile of this house
270
* @pre IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)
272
static inline void ResetHouseAge(TileIndex t)
274
assert(IsTileType(t, MP_HOUSE) && IsHouseCompleted(t));
279
* Increments the age of the house.
280
* @param t the tile of this house
281
* @pre IsTileType(t, MP_HOUSE)
283
static inline void IncrementHouseAge(TileIndex t)
285
assert(IsTileType(t, MP_HOUSE));
286
if (IsHouseCompleted(t) && _m[t].m5 < 0xFF) _m[t].m5++;
290
* Get the age of the house
275
291
* @param t the tile of this house
276
292
* @pre IsTileType(t, MP_HOUSE)
279
static inline Year GetHouseConstructionYear(TileIndex t)
295
static inline Year GetHouseAge(TileIndex t)
281
297
assert(IsTileType(t, MP_HOUSE));
282
return IsHouseCompleted(t) ? _m[t].m5 + ORIGINAL_BASE_YEAR : 0;
298
return IsHouseCompleted(t) ? _m[t].m5 : 0;