fix(wot): scrub NaN water height on load

A WOT water entry with non-finite height would push NaN through
the water mesh builder and produce a degenerate Vulkan draw
(invisible water at best, GPU hang at worst).
This commit is contained in:
Kelsi 2026-05-06 07:08:50 -07:00
parent b8e2d08b17
commit 1c1250a37c

View file

@ -138,6 +138,9 @@ bool WoweeTerrainLoader::loadMetadata(const std::string& wotPath, ADTTerrain& te
ADTTerrain::WaterLayer wl;
wl.liquidType = w.value("type", 0u);
wl.maxHeight = w.value("height", 0.0f);
// NaN water height would produce NaN vertex positions and
// a degenerate GPU draw, or crash the water mesh build.
if (!std::isfinite(wl.maxHeight)) wl.maxHeight = 0.0f;
wl.minHeight = wl.maxHeight;
wl.x = 0; wl.y = 0; wl.width = 9; wl.height = 9;
wl.heights.assign(81, wl.maxHeight);