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 | b58cdfc2942f07f231c1ee175b4a114ac6bf35ed (patch) | |
tree | 249698a6ee162bfe2dd153377c44d153495e1d6d /src/station_cmd.cpp | |
parent | 0c234209985458a8d3233dbf42d0a0e49457bf18 (diff) | |
download | openttd-b58cdfc2942f07f231c1ee175b4a114ac6bf35ed.tar.xz |
(svn r14992) -Codechange: Rename 'CheckIfAuthorityAllows' to 'CheckIfAuthorityAllowsNewStation' and unduplicate a tiny bit of code.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index f9d8d2bdd..e7a792c9a 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -921,7 +921,7 @@ static void GetStationLayout(byte *layout, int numtracks, int plat_len, const St CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint32 p2, const char *text) { /* Does the authority allow this? */ - if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile_org)) return CMD_ERROR; + if (!CheckIfAuthorityAllowsNewStation(tile_org, flags)) return CMD_ERROR; if (!ValParamRailtype((RailType)(p1 & 0xF))) return CMD_ERROR; /* unpack parameters */ @@ -1437,7 +1437,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, /* Road bits in the wrong direction */ if (build_over_road && (GetAllRoadBits(tile) & ((Axis)p1 == AXIS_X ? ROAD_Y : ROAD_X)) != 0) return_cmd_error(STR_DRIVE_THROUGH_ERROR_DIRECTION); - if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR; + if (!CheckIfAuthorityAllowsNewStation(tile, flags)) return CMD_ERROR; RoadTypes cur_rts = IsNormalRoadTile(tile) ? GetRoadTypes(tile) : ROADTYPES_NONE; uint num_roadbits = 0; @@ -1856,7 +1856,7 @@ CommandCost CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, /* Check if a valid, buildable airport was chosen for construction */ if (p1 > lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR; - if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) { + if (!CheckIfAuthorityAllowsNewStation(tile, flags)) { return CMD_ERROR; } @@ -2174,7 +2174,7 @@ CommandCost CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, con /* Docks cannot be placed on rapids */ if (IsWaterTile(tile)) return_cmd_error(STR_304B_SITE_UNSUITABLE); - if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR; + if (!CheckIfAuthorityAllowsNewStation(tile, flags)) return CMD_ERROR; if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |