mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 12:11:32 +00:00
Use subrecord size instead of version to load WEAT
This commit is contained in:
parent
51024a8208
commit
9a96d64611
1 changed files with 6 additions and 15 deletions
|
@ -29,26 +29,17 @@ namespace ESM
|
||||||
case fourCC("WEAT"):
|
case fourCC("WEAT"):
|
||||||
{
|
{
|
||||||
esm.getSubHeader();
|
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.mA = 0;
|
||||||
mData.mB = 0;
|
mData.mB = 0;
|
||||||
esm.getExact(&mData, sizeof(mData) - 2);
|
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
|
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