diff --git a/components/esm/variantimp.cpp b/components/esm/variantimp.cpp index 64dc980b8c..129b6c6d0e 100644 --- a/components/esm/variantimp.cpp +++ b/components/esm/variantimp.cpp @@ -52,7 +52,10 @@ void ESM::readESMVariantValue(ESMReader& esm, Variant::Format format, VarType ty esm.getHNT (value, "FLTV"); if (type==VT_Short) - out = static_cast (value); + if (isnan(value)) + out = 0; + else + out = static_cast (value); else if (type==VT_Long) out = static_cast (value); else