Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow rail when ships are on lower halftile #6505

Closed
DorpsGek opened this issue Sep 5, 2016 · 3 comments
Closed

Allow rail when ships are on lower halftile #6505

DorpsGek opened this issue Sep 5, 2016 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Sep 5, 2016

Samu opened the ticket and wrote:

This patch is aimed to fix an issue that is preventing construction of a rail track when there is a ship at the lower part of a water halftile on the opposite corner of the tile.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6505
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
@frosch123 frosch123 removed the Core label Apr 14, 2018
@Alberth289346
Copy link
Contributor

Currently, building tracks clears the partly water tile as it is being terraformed, in TerraformTile_Track:

/* Allow clearing the water only if there is no ship */
if (was_water && HasVehicleOnPos(tile, NULL, &EnsureNoShipProc)) return_cmd_error(STR_ERROR_SHIP_IN_THE_WAY);

This patch gets around that by not performing terraforming, but still add the cost for it. It currently duplicates cost calculation, which looks wrong, at least conceptually.

Aside from the unwanted cost duplication, to deal with this problem (as in, make it possible), tile clearing needs to be changed. There seem to be two paths:

  • Drop clearing the tile when adding track infra-structure where only a foundation is built. Note that currently, the water is not actually cleared if there is no ship. On the other hand, when performing the same operation on a full land tile, the entire tile is cleared.
  • Extend clearing to the point where some cases will not need clearing. The case shown in this issue would be one, other cases could eg be when there are no fences involved, or some other rule.

Either solution beaks consistency, complicates reasoning what will happen, and complicates the code. Since there don't seem to be many such edge cases, I think it would be reasonable to consider this issue to be non-solvable.

@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. Since OpenTTD moved to GitHub, we use pull requests rather than patches, as they are a much more productive workflow.

I'm planning to close this soon (in 7 days), as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun.

If you would like to continue with this patch, the best way would be to move the patch to your own GitHub fork, update it for the current OpenTTD master, and then create a pull request. For more information, please see our CONTRIBUTING.md.

We are also happy to discuss directly on the issue, or in #openttd irc, including help to get this into a pull request. Thanks for your contribution!

@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

Per Alberth's comments that this is non-solvable, and my 'issue is stale' message, I am closing. Thanks!

@andythenorth andythenorth removed patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay stale Stale issues labels Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

4 participants