Changeset - r10357:5287d890af09
[Not reviewed]
master
0 1 0
frosch - 16 years ago 2008-11-22 19:49:17
frosch@openttd.org
(svn r14608) -Fix (r9315): Return the current year as construction year for unfinished houses.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/town_map.h
Show inline comments
 
/* $Id$ */
 

	
 
/** @file town_map.h Accessors for towns */
 

	
 
#ifndef TOWN_MAP_H
 
#define TOWN_MAP_H
 

	
 
#include "town.h"
 
#include "date_type.h"
 
#include "date_func.h"
 
#include "tile_map.h"
 

	
 
/**
 
 * Get the index of which town this house/street is attached to.
 
 * @param t the tile
 
 * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD)
 
 * @return TownID
 
 */
 
static inline TownID GetTownIndex(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_ROAD)); // XXX incomplete
 
	return _m[t].m2;
 
@@ -276,25 +277,25 @@ static inline void SetHouseConstructionY
 
	_m[t].m5 = Clamp(year - GetHouseSpecs(GetHouseType(t))->min_year, 0, 0xFF);
 
}
 

	
 
/**
 
 * Get the year that this house was constructed.
 
 * @param t the tile of this house
 
 * @pre IsTileType(t, MP_HOUSE)
 
 * @return year
 
 */
 
static inline Year GetHouseConstructionYear(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	return IsHouseCompleted(t) ? _m[t].m5 + GetHouseSpecs(GetHouseType(t))->min_year : 0;
 
	return IsHouseCompleted(t) ? _m[t].m5 + GetHouseSpecs(GetHouseType(t))->min_year : _cur_year;
 
}
 

	
 
/**
 
 * 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));
0 comments (0 inline, 0 general)