diff options
author | frosch <frosch@openttd.org> | 2009-01-11 14:26:11 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-01-11 14:26:11 +0000 |
commit | f5cff712844a1fe853b750cba242f04b4e960c0e (patch) | |
tree | 249698a6ee162bfe2dd153377c44d153495e1d6d /src/town_cmd.cpp | |
parent | e8796a148ff26842fe6ae442f88119fda6181e7e (diff) | |
download | openttd-f5cff712844a1fe853b750cba242f04b4e960c0e.tar.xz |
(svn r14992) -Codechange: Rename 'CheckIfAuthorityAllows' to 'CheckIfAuthorityAllowsNewStation' and unduplicate a tiny bit of code.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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; |