From 3bd228f71b1dab4f5d454b1a1cb7b2506a94afaa Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 28 Feb 2013 11:50:29 +0100 Subject: [PATCH] fix for global variables of type short --- components/esm/loadglob.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/esm/loadglob.cpp b/components/esm/loadglob.cpp index 429c6ff1d..9e20578ce 100644 --- a/components/esm/loadglob.cpp +++ b/components/esm/loadglob.cpp @@ -20,6 +20,14 @@ void Global::load(ESMReader &esm) // Note: Both floats and longs are represented as floats. esm.getHNT(mValue, "FLTV"); + + if (mType==VT_Short) + { + if (mValue!=mValue) + mValue = 0; // nan + else + mValue = static_cast (mValue); + } } void Global::save(ESMWriter &esm)