From f5cff712844a1fe853b750cba242f04b4e960c0e Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 11 Jan 2009 14:26:11 +0000 Subject: (svn r14992) -Codechange: Rename 'CheckIfAuthorityAllows' to 'CheckIfAuthorityAllowsNewStation' and unduplicate a tiny bit of code. --- src/town_cmd.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/town_cmd.cpp') diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 1546f8cb3..429aeec50 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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; -- cgit v1.2.3-54-g00ecf