summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-05-27 01:59:07 +0000
committerglx <glx@openttd.org>2007-05-27 01:59:07 +0000
commit3db7a70057cef8715ac0860bb9cb49705b0b703c (patch)
tree78761997cd47fc4eed152e3819a255eb2c48898e /src/station_cmd.cpp
parent8c9b4ee548975f3b5db14468f3abc7a0534e4b09 (diff)
downloadopenttd-3db7a70057cef8715ac0860bb9cb49705b0b703c.tar.xz
(svn r9952) -Fix r9951: it was not possible to build a drive-through station over a road/tram
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index b1b628bf9..1d9b986c4 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -615,7 +615,7 @@ static int32 ClearTile_Station(TileIndex tile, byte flags);
// Tries to clear the given area. Returns the cost in case of success.
// Or an error code if it failed.
-int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invalid_dirs, StationID* station)
+int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invalid_dirs, StationID* station, bool check_clear = true)
{
int32 cost = 0;
int allowed_z = -1;
@@ -678,7 +678,7 @@ int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invali
return_cmd_error(STR_3006_ADJOINS_MORE_THAN_ONE_EXISTING);
}
}
- } else {
+ } else if (check_clear) {
int32 ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) return ret;
cost += ret;
@@ -1280,7 +1280,7 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* Do not remove roadtypes! */
rts |= cur_rts;
}
- cost = CheckFlatLandBelow(tile, 1, 1, flags, is_drive_through ? 5 << p1 : 1 << p1, NULL);
+ cost = CheckFlatLandBelow(tile, 1, 1, flags, is_drive_through ? 5 << p1 : 1 << p1, NULL, !build_over_road);
if (CmdFailed(cost)) return cost;
Station *st = NULL;