2015-01-16 23:11:36 +00:00
|
|
|
#include "importcellref.hpp"
|
|
|
|
|
2022-01-22 14:58:41 +00:00
|
|
|
#include <components/esm3/esmreader.hpp>
|
2015-01-16 23:11:36 +00:00
|
|
|
|
|
|
|
namespace ESSImport
|
|
|
|
{
|
|
|
|
|
|
|
|
void CellRef::load(ESM::ESMReader &esm)
|
|
|
|
{
|
2015-01-21 21:25:37 +00:00
|
|
|
blank();
|
|
|
|
|
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-22 02:34:44 +00:00
|
|
|
ActorData::load(esm);
|
2015-01-18 21:52:11 +00:00
|
|
|
if (esm.isNextSub("LVCR"))
|
2015-01-19 22:51:43 +00:00
|
|
|
{
|
2015-01-31 23:26:06 +00:00
|
|
|
// occurs on levelled creature spawner references
|
2015-01-22 03:12:08 +00:00
|
|
|
// probably some identifier for the creature that has been spawned?
|
2015-01-19 22:51:43 +00:00
|
|
|
unsigned char lvcr;
|
|
|
|
esm.getHT(lvcr);
|
|
|
|
//std::cout << "LVCR: " << (int)lvcr << std::endl;
|
|
|
|
}
|
2015-01-18 15:13:52 +00:00
|
|
|
|
|
|
|
mEnabled = true;
|
|
|
|
esm.getHNOT(mEnabled, "ZNAM");
|
|
|
|
|
2015-01-31 23:26:06 +00:00
|
|
|
// DATA should occur for all references, except levelled creature spawners
|
2015-01-21 21:25:37 +00:00
|
|
|
// I've seen DATA *twice* on a creature record, and with the exact same content too! weird
|
2015-01-18 21:52:11 +00:00
|
|
|
// alarmvoi0000.ess
|
2022-04-10 11:35:00 +00:00
|
|
|
esm.getHNOTSized<24>(mPos, "DATA");
|
|
|
|
esm.getHNOTSized<24>(mPos, "DATA");
|
2015-01-21 21:25:37 +00:00
|
|
|
|
|
|
|
mDeleted = 0;
|
|
|
|
if (esm.isNextSub("DELE"))
|
|
|
|
{
|
2015-01-22 22:28:43 +00:00
|
|
|
unsigned int deleted;
|
2015-01-21 21:25:37 +00:00
|
|
|
esm.getHT(deleted);
|
2015-03-06 10:19:57 +00:00
|
|
|
mDeleted = ((deleted >> 24) & 0x2) != 0; // the other 3 bytes seem to be uninitialized garbage
|
2015-01-21 21:25:37 +00:00
|
|
|
}
|
2015-01-18 21:52:11 +00:00
|
|
|
|
|
|
|
if (esm.isNextSub("MVRF"))
|
|
|
|
{
|
|
|
|
esm.skipHSub();
|
|
|
|
esm.getSubName();
|
|
|
|
esm.skipHSub();
|
|
|
|
}
|
2015-01-16 23:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|