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 commented Feb 8, 2019

No description provided.

@nielsmh

This comment has been minimized.

Copy link
Contributor

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 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 SamuXarick:remove-desert-around-lakes branch from 87f145d to 75f9ee3 Feb 18, 2019
@nielsmh

This comment has been minimized.

Copy link
Contributor

nielsmh commented Feb 23, 2019

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

@nielsmh

This comment has been minimized.

Copy link
Contributor

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 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
8 checks passed
OpenTTD CI Build #20190218.5 succeeded
Details
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.8) Linux linux-amd64-clang-3.8 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@SamuXarick SamuXarick deleted the SamuXarick: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
Projects
None yet
2 participants
You can’t perform that action at this time.