mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
fix biome choosing
This commit is contained in:
parent
9a909e2c1e
commit
2f93d38fde
1 changed files with 2 additions and 1 deletions
|
|
@ -133,11 +133,12 @@ static inline const Biome* choose_biome(
|
||||||
score += glm::abs((params[i] - biome.parameters[i].value) /
|
score += glm::abs((params[i] - biome.parameters[i].value) /
|
||||||
biome.parameters[i].weight);
|
biome.parameters[i].weight);
|
||||||
}
|
}
|
||||||
if (score < chosenScore) {
|
if (score < chosenScore || std::isinf(chosenScore)) {
|
||||||
chosenScore = score;
|
chosenScore = score;
|
||||||
chosenBiome = &biome;
|
chosenBiome = &biome;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert(chosenBiome != nullptr);
|
||||||
return chosenBiome;
|
return chosenBiome;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue