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

Fix: Don't allow towns to terraform certain floodable tiles #8492

Open
wants to merge 1 commit into
base: master
from

Conversation

@SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Jan 3, 2021

Prevent rare occurrences of roads and houses being flooded, resulting in disconnected towns.
See #8483.
This PR tries to fix the issue in a different manner. If the terraform command finds a certain floodable tile, the terraform fails. This works even for a sequence of commands during town generation. So far, the tests have not yet produced any flooded houses or roads.

Motivation / Problem

Description

Limitations

Void tiles are a problem. Terraform command ignores them. If the town terraforms one of the tiles at the edges of the map, there's no checking happening for the void tiles, and it may result in a flood coming in the direction of the void tile.
EDIT: I just added checks coming from the edge tiles. Terraform command shall fail if the resulting slope on an edge tile is flat and has a height of zero.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
@SamuXarick SamuXarick marked this pull request as draft Jan 4, 2021
@SamuXarick SamuXarick force-pushed the SamuXarick:town-terraforming branch from 3b54d10 to 64e0307 Jan 5, 2021
@SamuXarick SamuXarick changed the title Fix: Don't allow towns to terraform floodable tiles Fix: Don't allow towns to terraform certain floodable tiles Jan 5, 2021
@SamuXarick SamuXarick force-pushed the SamuXarick:town-terraforming branch 4 times, most recently from bb1550b to 348b3c0 Jan 5, 2021
@SamuXarick SamuXarick marked this pull request as ready for review Jan 5, 2021
@SamuXarick SamuXarick marked this pull request as draft Jan 6, 2021
@SamuXarick SamuXarick force-pushed the SamuXarick:town-terraforming branch 2 times, most recently from b58af8b to c214542 Jan 6, 2021
Prevent rare occurrences of roads and houses being flooded, resulting in disconnected towns.
@SamuXarick SamuXarick force-pushed the SamuXarick:town-terraforming branch from c214542 to 0ba13de Jan 8, 2021
@SamuXarick SamuXarick marked this pull request as ready for review Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant