forked from teamnwah/openmw-tes3coop
Fix loading ESX files cleaned with testool (Fixes #1382)
This commit is contained in:
parent
ce14a6413b
commit
7376cb9b61
1 changed files with 18 additions and 2 deletions
|
@ -12,10 +12,26 @@ void Region::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
mName = esm.getHNOString("FNAM");
|
mName = esm.getHNOString("FNAM");
|
||||||
|
|
||||||
|
esm.getSubNameIs("WEAT");
|
||||||
|
esm.getSubHeader();
|
||||||
if (esm.getVer() == VER_12)
|
if (esm.getVer() == VER_12)
|
||||||
esm.getHNExact(&mData, sizeof(mData) - 2, "WEAT");
|
{
|
||||||
|
mData.mA = 0;
|
||||||
|
mData.mB = 0;
|
||||||
|
esm.getExact(&mData, sizeof(mData) - 2);
|
||||||
|
}
|
||||||
else if (esm.getVer() == VER_13)
|
else if (esm.getVer() == VER_13)
|
||||||
esm.getHNExact(&mData, sizeof(mData), "WEAT");
|
{
|
||||||
|
// May include the additional two bytes (but not necessarily)
|
||||||
|
if (esm.getSubSize() == sizeof(mData))
|
||||||
|
esm.getExact(&mData, sizeof(mData));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mData.mA = 0;
|
||||||
|
mData.mB = 0;
|
||||||
|
esm.getExact(&mData, sizeof(mData)-2);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
esm.fail("Don't know what to do in this version");
|
esm.fail("Don't know what to do in this version");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue