2015-01-16 23:11:36 +00:00
|
|
|
#include "importcellref.hpp"
|
|
|
|
|
|
|
|
#include <components/esm/esmreader.hpp>
|
|
|
|
|
|
|
|
namespace ESSImport
|
|
|
|
{
|
|
|
|
|
|
|
|
void CellRef::load(ESM::ESMReader &esm)
|
|
|
|
{
|
|
|
|
esm.getHNT(mRefNum.mIndex, "FRMR"); // TODO: adjust RefNum
|
|
|
|
|
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 18:59:29 +00:00
|
|
|
// the following two occur in ESM::CellRef too (Charge and Gold),
|
|
|
|
// but may have entirely different meanings here
|
|
|
|
int intv;
|
|
|
|
esm.getHNOT(intv, "INTV");
|
|
|
|
int nam9;
|
|
|
|
esm.getHNOT(nam9, "NAM9");
|
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 18:59:29 +00:00
|
|
|
esm.getHNT(mPos, "DATA", 24);
|
2015-01-16 23:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|