diff options
author | rubidium <rubidium@openttd.org> | 2010-11-20 12:52:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-20 12:52:06 +0000 |
commit | ffa437a6c131243e9f797f4cc9164480b6aa38ac (patch) | |
tree | 28765122e5b300c1782505197dd544630f446c69 | |
parent | d6afbd025cff25c75f6cf9e1908a10c9b32a8752 (diff) | |
download | openttd-ffa437a6c131243e9f797f4cc9164480b6aa38ac.tar.xz |
(svn r21266) -Change: don't receive money for removing the rail of non-rail railstation tiles, i.e. rail station tiles for which the NewGRF has prevented trains to be routed
-rw-r--r-- | src/station_cmd.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index dc7665942..19c414b73 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1372,13 +1372,13 @@ restart: /** * Remove a number of tiles from any rail station within the area. - * @param ta the area to clear station tile from - * @param affected_stations the stations affected - * @param flags the command flags - * @param removal_cost the cost for removing the tile - * @param keep_rail whether to keep the rail of the station - * @tparam T the type of station to remove - * @return the number of cleared tiles or an error + * @param ta the area to clear station tile from. + * @param affected_stations the stations affected. + * @param flags the command flags. + * @param removal_cost the cost for removing the tile, including the rail. + * @param keep_rail whether to keep the rail of the station. + * @tparam T the type of station to remove. + * @return the number of cleared tiles or an error. */ template <class T> CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector<T *, 4> &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail) @@ -1455,8 +1455,9 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector<T *, 4> &affected if (IsRailStationTile(v->tile)) SetRailStationPlatformReservation(v->tile, TrackdirToExitdir(ReverseTrackdir(v->GetVehicleTrackdir())), true); } } - if (keep_rail) { - /* Don't refund the 'steel' of the track! */ + if (keep_rail || IsStationTileBlocked(tile)) { + /* Don't refund the 'steel' of the track when we keep the + * rail, or when the tile didn't have any rail at all. */ total_cost.AddCost(-_price[PR_CLEAR_RAIL]); } } |