Do not use architecture dependent type size_t in esm format (Fixes #3633)

pull/109/head
scrawl 8 years ago
parent c326564e20
commit 505250f6ec

@ -21,7 +21,18 @@ namespace ESM
anim.mGroup = esm.getHString();
esm.getHNOT(anim.mTime, "TIME");
esm.getHNOT(anim.mAbsolute, "ABST");
esm.getHNT(anim.mLoopCount, "COUN");
esm.getSubNameIs("COUN");
// workaround bug in earlier version where size_t was used
esm.getSubHeader();
if (esm.getSubSize() == 8)
esm.getT(anim.mLoopCount);
else
{
uint32_t loopcount;
esm.getT(loopcount);
anim.mLoopCount = (uint64_t) loopcount;
}
mScriptedAnims.push_back(anim);
}

@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <stdint.h>
namespace ESM
{
@ -20,7 +21,7 @@ namespace ESM
std::string mGroup;
float mTime;
bool mAbsolute;
size_t mLoopCount;
uint64_t mLoopCount;
};
typedef std::vector<ScriptedAnimation> ScriptedAnimations;

Loading…
Cancel
Save