The feature implemented by this patch is simple: when building roads and finding an obstacle, the road will be built up to that obstacle instead of not being built at all. This patch implements the feature suggested at FS #3318. As I mentioned at the Flyspray task, the patch code needs a review and some advice on how to implement it in a cleaner way. Any thoughts?
Version history
v05-r18798: Removed some parts included in trunk, code cleanup.
v04-r18762: Code cleanup, added some comments.
v03-r18683: Use DiagDir instead of a boolean value to check road direction (by Hirundo).
Terkhen wrote:The feature implemented by this patch is simple: when building roads and finding an obstacle, the road will be built up to that obstacle instead of not being built at all.
This is a great idea. It has been very annoying having to carefully replace the road so it doesn't interfere/touch the obstacle. I'm wondering, does the same thing happen for rails?
There is no reason for renaming total_cost besides copy pasting from the rail code: I'll revert the name and remove other unneeded modifications to the source code at the next version. start_tile and end_tile have been swapped because the cost always appear above the tile at the first parameter. If they weren't changed, the cost would appear above the end_tile selected by the user by dragging, which is not the final tile of the road actually built. This is the same solution implemented at the rail code.
New version uploaded, you can find it at the first post.
There is nothing new besides removing all unneeded changes to source code and updating the patch to current trunk. Since rivers can be created as rectangles (as opposed to only as lines) deciding when to continue building is not trivial. Canals are only built as lines ingame, but since they can be built as rectangles in the scenario editor, they share the same problem.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter. He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
A smaller new version, after some parts of the code (including parts of Hirundo's code) made it to trunk. Get the diff at the first post or at the flyspray task.
Edit: Patch in trunk since r18803
Last edited by Terkhen on 14 Jan 2010 23:59, edited 1 time in total.