summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-02-23 00:17:46 +0000
committerrubidium <rubidium@openttd.org>2007-02-23 00:17:46 +0000
commit202702c0077b4cda81cdc194fb225d3fc779c55a (patch)
tree7e92dee8a90a165f6b39d9c0ca40c40e554032cf /src/road_cmd.cpp
parentdcb217a6ace27ae989a59d8503c139f613694b1b (diff)
downloadopenttd-202702c0077b4cda81cdc194fb225d3fc779c55a.tar.xz
(svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
-Fix (r8735): remove drive through road stops on town owned roads when going bankrupt/being removed.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index caea8ea2d..d10639986 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -35,11 +35,10 @@ static uint CountRoadBits(RoadBits r)
}
-static bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, bool* edge_road)
+bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, bool *edge_road)
{
RoadBits present;
RoadBits n;
- Owner owner;
*edge_road = true;
if (_game_mode == GM_EDITOR) return true;
@@ -47,8 +46,6 @@ static bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, bool* edge_roa
// Only do the special processing for actual players.
if (!IsValidPlayer(_current_player)) return true;
- owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
-
// Only do the special processing if the road is owned
// by a town
if (owner != OWNER_TOWN) return (owner == OWNER_NONE) || CheckOwnership(owner);
@@ -81,6 +78,10 @@ static bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, bool* edge_roa
return true;
}
+static bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, bool *edge_road)
+{
+ return CheckAllowRemoveRoad(tile, remove, IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile), edge_road);
+}
/** Delete a piece of road.
* @param tile tile where to remove road from