diff options
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 9 |
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 |