Made that patch because you cannot deal with river as river and water doesn't work the same :
River : Must and can be clear. Cannot raise/lower corners. 100% chance of success
Water : Can be clear but you are wasting huge money. You can lower/raise corners. Chance of sucess depend on adjacent tiles state.
- So in order to know cost to clear an area that include water, you must know each tile cost to clear, but if your area with water isn't a river, you get a too low result as you must include raise/lower costs, without any warrant you would success.
- Raise/lower corners works in testmode, but clearing tile doesn't :
- An invalid path because a tile is water and adjacent tiles prevent terraforming, is just a valid path if those water tiles are river, as you clear the river tile and replace it with your road.
- Jumping a water tile == a minimal size of 3 tiles for a bridge, a river = just a road
- BT_CLEAR_RIVER is there to answer the cost to clear a tile with a river, allowing dev to calc total cost to clear an area. Without handling river, there's no need to get cost to clear a water, as the water tile itself is always clear. Hence why no BT_CLEAR_WATER exists. But you just have to query a water tile to see there's a cost to clear a water tile
So clearing a water is stupid, it do nothing, except take your money, but clearing a water tile is the way to remove a river.
When dealing with water/river the amount of money put on the table is not something you could just play with. You must be able to take decision before going into such investments.
So that's why i create IsRiverTile. You might goes into a bunch of tricky tests to determine if a tile is water or river (looking at height, looking at size of area >3)... But none are 100% perfect, and worst, add complexity to functions that per themselves are time earter already (pathfinding and terraforming)