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

Mgv7 spawn search: Cope with extreme custom terrain and biome 'dust' #5961

Closed
wants to merge 1 commit into from
Closed

Conversation

paramat
Copy link
Contributor

@paramat paramat commented Jun 11, 2017

Previously, maximum spawn level was set to 'water_level + 16'. This would result
in spawn search failing if terrain had been customised to be much higher than
'water_level' at all points.

Also raise spawn level by 1 node to avoid spawning half-buried in a biome 'dust'
node such as 'default:snowblock'.
//////////////

Tested.
Making mgv7 spawn search more robust has been needed for a while, and was asked for by hmmmm 1-2 years ago.
Currently it is common to spawn half-buried in a snowblock biome 'dust' node.

@paramat paramat added @ Mapgen Bugfix 🐛 PRs that fix a bug labels Jun 11, 2017
Previously, maximum spawn level was set to 'water_level + 16'. This would result
in spawn search failing if terrain had been customised to be much higher than
'water_level' at all points.

Also raise spawn level by 1 node to avoid spawning half-buried in a biome 'dust'
node such as 'default:snowblock'.
@paramat
Copy link
Contributor Author

paramat commented Jun 19, 2017

Further testing and fine.
I'll merge this as it is not a major change, is internal to mgv7 and is changes to code i wrote and know well, i hope this is ok.

@paramat paramat added the Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines label Jun 19, 2017
@paramat
Copy link
Contributor Author

paramat commented Jun 19, 2017

ea4d407

@paramat paramat closed this Jun 19, 2017
while (iters--) {
// Search upwards for first node without mountain terrain
int iters = 256;
while (iters > 0 && y <= max_spawn_y) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems this loop is a good canditate to be replaced with a for loop

@paramat paramat deleted the mgv7spawn branch June 21, 2017 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug @ Mapgen Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants