File diff r27271:e0993573a0ba → r27272:bb139906001a
src/newgrf_house.cpp
Show inline comments
 
@@ -143,31 +143,30 @@ void DecreaseBuildingCount(Town *t, Hous
 
	return this->not_yet_constructed ? this->initial_random_bits : GetHouseRandomBits(this->tile);
 
}
 

	
 
/* virtual */ uint32 HouseScopeResolver::GetTriggers() const
 
{
 
	/* Note: Towns build houses over houses. So during construction checks 'tile' may be a valid but unrelated house. */
 
	assert(IsValidTile(this->tile) && (this->not_yet_constructed || IsTileType(this->tile, MP_HOUSE)));
 
	return this->not_yet_constructed ? 0 : GetHouseTriggers(this->tile);
 
}
 

	
 
static uint32 GetNumHouses(HouseID house_id, const Town *town)
 
{
 
	uint8 map_id_count, town_id_count, map_class_count, town_class_count;
 
	HouseClassID class_id = HouseSpec::Get(house_id)->class_id;
 

	
 
	map_id_count     = ClampU(_building_counts.id_count[house_id], 0, 255);
 
	map_class_count  = ClampU(_building_counts.class_count[class_id], 0, 255);
 
	town_id_count    = ClampU(town->cache.building_counts.id_count[house_id], 0, 255);
 
	town_class_count = ClampU(town->cache.building_counts.class_count[class_id], 0, 255);
 
	uint8_t map_id_count     = ClampTo<uint8_t>(_building_counts.id_count[house_id]);
 
	uint8_t map_class_count  = ClampTo<uint8_t>(_building_counts.class_count[class_id]);
 
	uint8_t town_id_count    = ClampTo<uint8_t>(town->cache.building_counts.id_count[house_id]);
 
	uint8_t town_class_count = ClampTo<uint8_t>(town->cache.building_counts.class_count[class_id]);
 

	
 
	return map_class_count << 24 | town_class_count << 16 | map_id_count << 8 | town_id_count;
 
}
 

	
 
/**
 
 * Get information about a nearby tile.
 
 * @param parameter from callback. It's in fact a pair of coordinates
 
 * @param tile TileIndex from which the callback was initiated
 
 * @param grf_version8 True, if we are dealing with a new NewGRF which uses GRF version >= 8.
 
 * @return a construction of bits obeying the newgrf format
 
 */
 
static uint32 GetNearbyTileInformation(byte parameter, TileIndex tile, bool grf_version8)