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

Cavegen: Fix variable typo that broke mgvalleys large cave distribution #7249

Merged
merged 1 commit into from Apr 17, 2018
Merged

Cavegen: Fix variable typo that broke mgvalleys large cave distribution #7249

merged 1 commit into from Apr 17, 2018

Conversation

paramat
Copy link
Contributor

@paramat paramat commented Apr 17, 2018

Fixes #7244 (comment)
'max_stone_y' did not match the function argument 'max_stone_height', see the same line in CavesV6::makeCave() which does match the function argument:

route_y_max = -of.Y + max_stone_height + max_tunnel_diameter / 2 + 7;

max_stone_y still worked and didn't cause a compile error somehow, maybe because it is present here:
s16 max_stone_y;

And here:
void MapgenBasic::generateCaves(s16 max_stone_y, s16 large_cave_depth)

So mgvalleys large caves were broken all this time.

@paramat
Copy link
Contributor Author

paramat commented Apr 17, 2018

This fix was made to CavesV6() in a605d69 May2016

-	route_y_max = -of.Y + max_stone_y + max_tunnel_diameter / 2 + 7;
+	route_y_max = -of.Y + max_stone_height + max_tunnel_diameter / 2 + 7;

But wasn't done in the general large caves code CavesRandomWalk::makeCave() at that time.

The error has actually been present since 03868ff April 2013
Here in 0.4.6 it was correct, the function argument was 'max_stone_y':

void MapgenV6::generateCaves(int max_stone_y) {

s16 route_y_max = -of.Y + max_stone_y + cave.max_tunnel_diameter/2 + 7;

@paramat
Copy link
Contributor Author

paramat commented Apr 17, 2018

Mgv7 tested and fine.

Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
@paramat
Copy link
Contributor Author

paramat commented Apr 17, 2018

Updated to remove unused variable from header file.

@paramat paramat merged commit cca9253 into minetest:master Apr 17, 2018
@paramat paramat deleted the mgvalfixlctest branch April 20, 2018 21:45
sfan5 pushed a commit that referenced this pull request May 13, 2018
…on (#7249)

Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
@sfan5 sfan5 mentioned this pull request May 13, 2018
sfan5 pushed a commit that referenced this pull request May 13, 2018
…on (#7249)

Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
SmallJoker pushed a commit that referenced this pull request Jun 3, 2018
…on (#7249)

Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
…on (minetest#7249)

Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants