Fix #7656: destroying a tunnel/bridge now first removes the tracks for cost calculation #8508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7656 .
Motivation / Problem
When you build a road bridge, put tram tracks on it, and destroy the road+tram bridge, you had to pay money.
If you first removed the tram tracks and destroyed the road bridge, you gained money.
This is rather unfair, to expect a player to know the difference.
This is an effect of allowing road + tram on the same bridge, where you can build either/or on them. A player that pays attention will, without a solution like this, always notice a discrepancy. If you build a road bridge and a tram bridge and a road+tram bridge, you notice quickly enough that something is not adding up.
Description
To not over-complicate the code, I went for a simple approach: destroying a bridge is now a fixed-free + the price to remove the road/tram/rail from the bridge. In most cases this benefits the player, in some it does not.
Removing rail and tram makes you receive money, so bridges that have either of the two, are now (a lot) cheaper to destroy. Road bridges on the other hand are now slightly more expensive. I consider this an acceptable compromise.
While looking into this, I also found that destroying a bridge didn't asked you money for the end-tile (off-by-one).
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.