From 2f93d38fde79a8ce4d8db27d750ced4a6047e524 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 25 Jan 2025 02:10:44 +0300 Subject: [PATCH] fix biome choosing --- src/world/generator/WorldGenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/world/generator/WorldGenerator.cpp b/src/world/generator/WorldGenerator.cpp index b0515c24..a86565ec 100644 --- a/src/world/generator/WorldGenerator.cpp +++ b/src/world/generator/WorldGenerator.cpp @@ -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; }