summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-31 23:04:47 +0000
committerDarkvater <darkvater@openttd.org>2006-10-31 23:04:47 +0000
commit5535e370c53b7ec9586cd2d9a9ed8504b95fe719 (patch)
treebde58814b1696e3cec9d568a39073107e35c4dce /road_cmd.c
parented3c75f53241a1524b2ca7b2e8ec3dbfe6100c74 (diff)
downloadopenttd-5535e370c53b7ec9586cd2d9a9ed8504b95fe719.tar.xz
(svn r7028) -Fix [FS#200]: Scenario bridges/tunnels cannot be demolished; now it's possible to
delete tunnels/bridges owned by nobody.
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 7d6f5b0f2..7828d0abc 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -110,7 +110,10 @@ int32 CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) {
- if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)
+ /* Are we removing a piece of road below a bridge, or not. If below
+ * a bridge we need to calculate the town's index as it is not saved
+ * in the map array (no space) */
+ if (IsTileType(tile, MP_TUNNELBRIDGE)) {
t = ClosestTownFromTile(tile, _patches.dist_local_authority);
} else {
t = GetTownByTile(tile);