1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 19:20:49 +00:00

Merge branch 'region_size' into 'master'

Use subrecord size instead of version to load WEAT

See merge request OpenMW/openmw!1814
This commit is contained in:
jvoisin 2022-04-30 15:13:26 +00:00
commit 5afe3fb8ae

View File

@ -29,26 +29,17 @@ namespace ESM
case fourCC("WEAT"):
{
esm.getSubHeader();
if (esm.getVer() == VER_12)
// May include the additional two bytes (but not necessarily)
if (esm.getSubSize() == sizeof(mData))
{
esm.getT(mData);
}
else if (esm.getSubSize() == sizeof(mData) - 2)
{
mData.mA = 0;
mData.mB = 0;
esm.getExact(&mData, sizeof(mData) - 2);
}
else if (esm.getVer() == VER_13)
{
// May include the additional two bytes (but not necessarily)
if (esm.getSubSize() == sizeof(mData))
{
esm.getT(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");