1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Maybe load FO4 cell references

This commit is contained in:
Alexei Kotov 2023-08-16 14:26:05 +03:00
parent 5a73b351e2
commit 95488d6ec9
2 changed files with 32 additions and 10 deletions

View file

@ -38,9 +38,6 @@ void ESM4::Reference::load(ESM4::Reader& reader)
mFlags = reader.hdr().record.flags; mFlags = reader.hdr().record.flags;
mParent = reader.currCell(); mParent = reader.currCell();
std::uint32_t esmVer = reader.esmVersion();
bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134;
ESM::FormId mid; ESM::FormId mid;
ESM::FormId sid; ESM::FormId sid;
@ -87,13 +84,23 @@ void ESM4::Reference::load(ESM4::Reader& reader)
} }
case ESM4::SUB_XTEL: case ESM4::SUB_XTEL:
{ {
reader.getFormId(mDoor.destDoor); if (subHdr.dataSize == 28 || subHdr.dataSize == 32 || subHdr.dataSize == 36)
reader.get(mDoor.destPos); {
if (esmVer == ESM::VER_094 || esmVer == ESM::VER_170 || isFONV) reader.getFormId(mDoor.destDoor);
reader.get(mDoor.flags); // not in Obvlivion reader.get(mDoor.destPos);
else
mDoor.flags = 0; mDoor.flags = 0;
// std::cout << "REFR dest door: " << formIdToString(mDoor.destDoor) << std::endl;// FIXME if (subHdr.dataSize == 32 || subHdr.dataSize == 36)
{
reader.get(mDoor.flags);
// FO4
if (subHdr.dataSize == 36)
reader.getFormId(mDoor.transitionInt);
}
}
else
{
reader.skipSubRecordData();
}
break; break;
} }
case ESM4::SUB_XSED: case ESM4::SUB_XSED:
@ -201,6 +208,7 @@ void ESM4::Reference::load(ESM4::Reader& reader)
break; // FONV break; // FONV
case ESM4::SUB_XRDO: // FO3 case ESM4::SUB_XRDO: // FO3
{ {
// FIXME: completely different meaning in FO4
reader.get(mRadio.rangeRadius); reader.get(mRadio.rangeRadius);
reader.get(mRadio.broadcastRange); reader.get(mRadio.broadcastRange);
reader.get(mRadio.staticPercentage); reader.get(mRadio.staticPercentage);
@ -288,7 +296,7 @@ void ESM4::Reference::load(ESM4::Reader& reader)
case ESM4::SUB_XTRI: case ESM4::SUB_XTRI:
case ESM4::SUB_XWCN: case ESM4::SUB_XWCN:
case ESM4::SUB_XWCU: case ESM4::SUB_XWCU:
case ESM4::SUB_XATR: // Dawnguard only? case ESM4::SUB_XATR:
case ESM4::SUB_XHLT: // Unofficial Oblivion Patch case ESM4::SUB_XHLT: // Unofficial Oblivion Patch
case ESM4::SUB_XCHG: // thievery.exp case ESM4::SUB_XCHG: // thievery.exp
case ESM4::SUB_XHLP: // FO3 case ESM4::SUB_XHLP: // FO3
@ -312,6 +320,19 @@ void ESM4::Reference::load(ESM4::Reader& reader)
case ESM4::SUB_XSRD: // FONV case ESM4::SUB_XSRD: // FONV
case ESM4::SUB_WMI1: // FONV case ESM4::SUB_WMI1: // FONV
case ESM4::SUB_XLRL: // Unofficial Skyrim Patch case ESM4::SUB_XLRL: // Unofficial Skyrim Patch
case ESM4::SUB_XASP: // FO4
case ESM4::SUB_XATP: // FO4
case ESM4::SUB_XBSD: // FO4
case ESM4::SUB_XCVR: // FO4
case ESM4::SUB_XCZR: // FO4
case ESM4::SUB_XLKT: // FO4
case ESM4::SUB_XLYR: // FO4
case ESM4::SUB_XMSP: // FO4
case ESM4::SUB_XPDD: // FO4
case ESM4::SUB_XPLK: // FO4
case ESM4::SUB_XRFG: // FO4
case ESM4::SUB_XWPG: // FO4
case ESM4::SUB_XWPN: // FO4
// if (mFormId == 0x0007e90f) // XPRM XPOD // if (mFormId == 0x0007e90f) // XPRM XPOD
// if (mBaseObj == 0x17) //XPRM XOCP occlusion plane data XMBO bound half extents // if (mBaseObj == 0x17) //XPRM XOCP occlusion plane data XMBO bound half extents
reader.skipSubRecordData(); reader.skipSubRecordData();

View file

@ -61,6 +61,7 @@ namespace ESM4
ESM::FormId destDoor; ESM::FormId destDoor;
ESM::Position destPos; ESM::Position destPos;
std::uint32_t flags = 0; // 0x01 no alarm (only in TES5) std::uint32_t flags = 0; // 0x01 no alarm (only in TES5)
ESM::FormId transitionInt;
}; };
struct RadioStationData struct RadioStationData