fix biome choosing

This commit is contained in:
MihailRis 2025-01-25 02:10:44 +03:00
parent 9a909e2c1e
commit 2f93d38fde

View File

@ -133,11 +133,12 @@ static inline const Biome* choose_biome(
score += glm::abs((params[i] - biome.parameters[i].value) /
biome.parameters[i].weight);
}
if (score < chosenScore) {
if (score < chosenScore || std::isinf(chosenScore)) {
chosenScore = score;
chosenBiome = &biome;
}
}
assert(chosenBiome != nullptr);
return chosenBiome;
}