fix(water): skip chunks with NaN water height in mesh build

Belt-and-braces — WOT load already scrubs the height to 0 if non-
finite, but if a downstream caller mutates terrain.waterData
in-memory the bad value would leak into the water mesh and Vulkan
would drop the entire batch on a single bad chunk.
This commit is contained in:
Kelsi 2026-05-06 08:04:44 -07:00
parent 55f9616aa6
commit c9c4665642

View file

@ -3,6 +3,7 @@
#include "rendering/vk_shader.hpp"
#include "core/logger.hpp"
#include <cstring>
#include <cmath>
namespace wowee {
namespace editor {
@ -61,6 +62,10 @@ void EditorWater::update(const pipeline::ADTTerrain& terrain, int tileX, int til
float y1 = y0 - CHUNK_SIZE;
float h = water.layers[0].maxHeight;
// NaN water height would produce NaN vertex positions and
// Vulkan would drop the whole water mesh. WOT load already
// scrubs but defending here is cheap insurance.
if (!std::isfinite(h)) continue;
// Water color by type
float r = 0.1f, g = 0.3f, b = 0.7f, a = 0.45f;