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

Comments

@DorpsGek
Copy link

@DorpsGek 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
@Alberth289346

This comment has been minimized.

Copy link
Contributor

@Alberth289346 Alberth289346 commented Jun 24, 2018

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

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 5, 2019

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 label Jan 5, 2019
@andythenorth

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 12, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.