mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
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");
|
||||
|
||||
esm.getSubNameIs("WEAT");
|
||||
esm.getSubHeader();
|
||||
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)
|
||||
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
|
||||
esm.fail("Don't know what to do in this version");
|
||||
|
||||
|
|
Loading…
Reference in a new issue