2015-01-16 23:11:36 +00:00
|
|
|
#include "importcellref.hpp"
|
|
|
|
|
|
|
|
#include <components/esm/esmreader.hpp>
|
|
|
|
|
|
|
|
namespace ESSImport
|
|
|
|
{
|
|
|
|
|
|
|
|
void CellRef::load(ESM::ESMReader &esm)
|
|
|
|
{
|
2015-01-18 23:35:19 +00:00
|
|
|
// (FRMR subrecord name is already read by the loop in ConvertCell)
|
|
|
|
esm.getHT(mRefNum.mIndex); // FRMR
|
2015-01-16 23:11:36 +00:00
|
|
|
|
2015-01-18 15:13:52 +00:00
|
|
|
// this is required since openmw supports more than 255 content files
|
|
|
|
int pluginIndex = (mRefNum.mIndex & 0xff000000) >> 24;
|
|
|
|
mRefNum.mContentFile = pluginIndex-1;
|
|
|
|
mRefNum.mIndex &= 0x00ffffff;
|
|
|
|
|
2015-01-16 23:11:36 +00:00
|
|
|
mIndexedRefId = esm.getHNString("NAME");
|
|
|
|
|
2015-01-18 21:52:11 +00:00
|
|
|
if (esm.isNextSub("LVCR"))
|
|
|
|
esm.skipHSub();
|
2015-01-16 23:11:36 +00:00
|
|
|
|
2015-01-18 18:59:29 +00:00
|
|
|
mActorData.load(esm);
|
2015-01-18 15:13:52 +00:00
|
|
|
|
|
|
|
mEnabled = true;
|
|
|
|
esm.getHNOT(mEnabled, "ZNAM");
|
|
|
|
|
2015-01-18 21:52:11 +00:00
|
|
|
// should occur for all references but not levelled creature spawners
|
|
|
|
esm.getHNOT(mPos, "DATA", 24);
|
|
|
|
|
|
|
|
// i've seen DATA record TWICE on a creature record - and with the exact same content too! weird
|
|
|
|
// alarmvoi0000.ess
|
|
|
|
esm.getHNOT(mPos, "DATA", 24);
|
|
|
|
|
|
|
|
if (esm.isNextSub("MVRF"))
|
|
|
|
{
|
|
|
|
esm.skipHSub();
|
|
|
|
esm.getSubName();
|
|
|
|
esm.skipHSub();
|
|
|
|
}
|
2015-01-16 23:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|