diff --git a/src/pipeline/wowee_building.cpp b/src/pipeline/wowee_building.cpp index ee002b9d..5204c2fc 100644 --- a/src/pipeline/wowee_building.cpp +++ b/src/pipeline/wowee_building.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace wowee { @@ -105,6 +106,10 @@ WoweeBuilding WoweeBuildingLoader::load(const std::string& basePath) { f.read(reinterpret_cast(&dp.position), 12); f.read(reinterpret_cast(&dp.rotation), 12); f.read(reinterpret_cast(&dp.scale), 4); + // Guard against corrupted scale (older WoBs that hadn't initialized + // the field, or NaNs from a partial write). The renderer would + // collapse the doodad to a point with scale 0. + if (!std::isfinite(dp.scale) || dp.scale <= 0.0001f) dp.scale = 1.0f; bld.doodads.push_back(dp); }