1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Use isnan

This commit is contained in:
jvoisin 2021-04-17 20:58:09 +02:00
parent 38316cdaf8
commit c0f7e0d585

View File

@ -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<short> (value);
if (isnan(value))
out = 0;
else
out = static_cast<short> (value);
else if (type==VT_Long)
out = static_cast<int> (value);
else