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: Remove desert around lakes upon generation. #7194

Merged
merged 2 commits into from Feb 23, 2019

Conversation

@SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Feb 8, 2019

No description provided.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 18, 2019

So this is an extremely rare case I think? The code looks fine, but by the context I can see the prelude to each of the added blocks checks for "tile is not desert". So this would only apply to rivers ending in a lake right at the edge of a desert.

Copy link
Contributor

@nielsmh nielsmh left a comment

Looks correct, but with the constant 5 now being repeated four times in the code (after applying this patch), I think it would be appropriate to change it to a named constant. Maybe name it RIVER_OFFSET_DESERT_DISTANCE and put in water.h together with the declaration of RiverModifyDesertZone.

@SamuXarick SamuXarick force-pushed the remove-desert-around-lakes branch from 87f145d to 75f9ee3 Feb 18, 2019
@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 23, 2019

I wonder if there is an easy way to trigger the issue this intends to fix...

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 23, 2019

I hacked in a console command to force a river, and got it to make a lake in a tropical zone bordering a desert zone. This is the result in master without this patch:

image

This is with the patch, the marked tiles were desert before the river command:

image

Copy link
Contributor

@nielsmh nielsmh left a comment

It doesn't look like a common issue, but the fix is clear.

@nielsmh nielsmh merged commit 4adb912 into OpenTTD:master Feb 23, 2019
8 checks passed
@SamuXarick SamuXarick deleted the remove-desert-around-lakes branch Feb 27, 2019
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

2 participants