(svn r14992) -Codechange: Rename 'CheckIfAuthorityAllows' to 'CheckIfAuthorityAllowsNewStation' and unduplicate a tiny bit of code.

This commit is contained in:
frosch
2009-01-11 14:26:11 +00:00
parent e8796a148f
commit f5cff71284
3 changed files with 12 additions and 7 deletions

View File

@@ -2445,9 +2445,14 @@ static void UpdateTownUnwanted(Town *t)
}
}
bool CheckIfAuthorityAllows(TileIndex tile)
/**
* Checks whether the local authority allows construction of a new station (rail, road, airport, dock) on the given tile
* @param tile The tile where the station shall be constructed.
* @param flags Command flags. DC_NO_TOWN_RATING is tested.
*/
bool CheckIfAuthorityAllowsNewStation(TileIndex tile, uint32 flags)
{
if (!IsValidCompanyID(_current_company)) return true;
if (!IsValidCompanyID(_current_company) || (flags & DC_NO_TOWN_RATING)) return true;
Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
if (t == NULL) return true;