Changeset - r9483:faf01c4a046b
[Not reviewed]
master
0 2 0
belugas - 16 years ago 2008-06-10 00:42:19
belugas@openttd.org
(svn r13437) -Feature[newGRF]: Add long format introduction and maximum construction year for house.
2 files changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -1538,6 +1538,14 @@ static bool TownHouseChangeInfo(uint hid
 
				ret = true;
 
			} break;
 

	
 
			case 0x21: // long introduction year
 
				housespec->min_year = grf_load_word(&buf);
 
				break;
 

	
 
			case 0x22: // long maximum year
 
				housespec->max_year = grf_load_word(&buf);
 
				break;
 

	
 
			default:
 
				ret = true;
 
				break;
src/town_map.h
Show inline comments
 
@@ -265,7 +265,7 @@ static inline void IncHouseConstructionT
 
}
 

	
 
/**
 
 * Set the year that this house was constructed (between 1920 and 2175).
 
 * Set the year that this house was constructed.
 
 * @param t the tile of this house
 
 * @param year the year to set
 
 * @pre IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)
 
@@ -273,11 +273,11 @@ static inline void IncHouseConstructionT
 
static inline void SetHouseConstructionYear(TileIndex t, Year year)
 
{
 
	assert(IsTileType(t, MP_HOUSE) && IsHouseCompleted(t));
 
	_m[t].m5 = Clamp(year - ORIGINAL_BASE_YEAR, 0, 0xFF);
 
	_m[t].m5 = Clamp(year - GetHouseSpecs(GetHouseType(t))->min_year, 0, 0xFF);
 
}
 

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

	
 
/**
0 comments (0 inline, 0 general)