The International Simutrans Forum

Simutrans Extended => Patches/pull requests for consideration => Simutrans-Extended development => Incorporated patches/merged pull requests => Topic started by: freddyhayward on November 03, 2020, 05:55:10 AM

Title: Pull Request: fix for cities building single-height bridges over navigable water
Post by: freddyhayward on November 03, 2020, 05:55:10 AM
https://github.com/jamespetts/simutrans-extended/pull/297
Title: Re: Pull Request: fix for cities building single-height bridges over navigable water
Post by: jamespetts on November 03, 2020, 05:14:33 PM
Thank you for this. I notice that you have changed the following line of code:


const bool public_service = player ? player->is_public_service() : true;


to this:


const bool public_service = player ? player->is_public_service() : false;


This will cause roads built automatically by towns and industries not to be treated as being built by the public service player for these purposes. May I ask whether this was intended?

The current code allows automatically built bridges to be single height over navigable ways only if the ways have not been used recently (the current or previous game month). Is this not sufficient; or does this not work properly?
Title: Re: Pull Request: fix for cities building single-height bridges over navigable water
Post by: freddyhayward on November 03, 2020, 08:49:59 PM
Quote from: jamespetts on November 03, 2020, 05:14:33 PMThis will cause roads built automatically by towns and industries not to be treated as being built by the public service player for these purposes. May I ask whether this was intended?
Yes, because being the public service would exempt towns and industries from most of the restrictions.

Quote from: jamespetts on November 03, 2020, 05:14:33 PMThe current code allows automatically built bridges to be single height over navigable ways only if the ways have not been used recently (the current or previous game month). Is this not sufficient; or does this not work properly?
It is not sufficient because it allows for public right of ways to be frequently blocked. Traffic on the way might have just started, or be less frequent than once per two months. And in any case, single-height bridges being built in map generation causes almost all navigable rivers to be blocked. Also, the principle of public rights of way should be that it can't be blocked at any time.
Title: Re: Pull Request: fix for cities building single-height bridges over navigable water
Post by: jamespetts on January 10, 2021, 07:57:57 PM
I have merged a modified version of this into the master branch - without the modifications, inter-city roads would often not build properly, leaving gaps over rivers.
Title: Re: Pull Request: fix for cities building single-height bridges over navigable water
Post by: freddyhayward on January 11, 2021, 01:19:58 AM
Quote from: jamespetts on January 10, 2021, 07:57:57 PMI have merged a modified version of this into the master branch - without the modifications, inter-city roads would often not build properly, leaving gaps over rivers.
Your modifications allow intercity roads to block rivers using low bridges, and I wasn't able to reproduce that issue in the original branch.