From ca30288c9d0057c62712973ae2c126195c8c9df5 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 24 May 2008 22:15:10 +0000 Subject: (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops. -Fix: Reset the 'town-owned-road'-flag when removing and rebuilding road under drivethrough stops. --- src/station_cmd.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/station_cmd.cpp') diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 302d36c19..7dd69c99d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2995,16 +2995,15 @@ static void ChangeTileOwner_Station(TileIndex tile, PlayerID old_player, PlayerI * Road stops built on town-owned roads check the conditions * that would allow clearing of the original road. * @param tile road stop tile to check + * @param flags command flags * @return true if the road can be cleared */ -static bool CanRemoveRoadWithStop(TileIndex tile) +static bool CanRemoveRoadWithStop(TileIndex tile, uint32 flags) { /* The road can always be cleared if it was not a town-owned road */ if (!GetStopBuiltOnTownRoad(tile)) return true; - bool edge_road; - return CheckAllowRemoveRoad(tile, GetAnyRoadBits(tile, ROADTYPE_ROAD), OWNER_TOWN, &edge_road, ROADTYPE_ROAD) && - CheckAllowRemoveRoad(tile, GetAnyRoadBits(tile, ROADTYPE_TRAM), OWNER_TOWN, &edge_road, ROADTYPE_TRAM); + return CheckAllowRemoveRoad(tile, GetAnyRoadBits(tile, ROADTYPE_ROAD), OWNER_TOWN, ROADTYPE_ROAD, flags); } static CommandCost ClearTile_Station(TileIndex tile, byte flags) @@ -3029,11 +3028,11 @@ static CommandCost ClearTile_Station(TileIndex tile, byte flags) case STATION_RAIL: return RemoveRailroadStation(st, tile, flags); case STATION_AIRPORT: return RemoveAirport(st, flags); case STATION_TRUCK: - if (IsDriveThroughStopTile(tile) && !CanRemoveRoadWithStop(tile)) + if (IsDriveThroughStopTile(tile) && !CanRemoveRoadWithStop(tile, flags)) return_cmd_error(STR_3047_MUST_DEMOLISH_TRUCK_STATION); return RemoveRoadStop(st, flags, tile); case STATION_BUS: - if (IsDriveThroughStopTile(tile) && !CanRemoveRoadWithStop(tile)) + if (IsDriveThroughStopTile(tile) && !CanRemoveRoadWithStop(tile, flags)) return_cmd_error(STR_3046_MUST_DEMOLISH_BUS_STATION); return RemoveRoadStop(st, flags, tile); case STATION_BUOY: return RemoveBuoy(st, flags); -- cgit v1.2.3-70-g09d2