File diff r3982:ca4216349503 → r3983:b2c269b85722
town_cmd.c
Show inline comments
 
@@ -1739,18 +1739,12 @@ bool CheckIfAuthorityAllows(TileIndex ti
 
}
 

	
 

	
 
Town *ClosestTownFromTile(TileIndex tile, uint threshold)
 
Town* CalcClosestTownFromTile(TileIndex tile, uint threshold)
 
{
 
	Town *t;
 
	uint dist, best = threshold;
 
	Town *best_town = NULL;
 

	
 
	if (IsTileType(tile, MP_HOUSE) || (
 
				IsTileType(tile, MP_STREET) &&
 
				(IsLevelCrossing(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile)) == OWNER_TOWN
 
			))
 
		return GetTownByTile(tile);
 

	
 
	FOR_ALL_TOWNS(t) {
 
		if (t->xy != 0) {
 
			dist = DistanceManhattan(tile, t->xy);
 
@@ -1764,6 +1758,20 @@ Town *ClosestTownFromTile(TileIndex tile
 
	return best_town;
 
}
 

	
 

	
 
Town *ClosestTownFromTile(TileIndex tile, uint threshold)
 
{
 
	if (IsTileType(tile, MP_HOUSE) || (
 
				IsTileType(tile, MP_STREET) &&
 
				(IsLevelCrossing(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile)) == OWNER_TOWN
 
			)) {
 
		return GetTownByTile(tile);
 
	} else {
 
		return CalcClosestTownFromTile(tile, threshold);
 
	}
 
}
 

	
 

	
 
void ChangeTownRating(Town *t, int add, int max)
 
{
 
	int rating;