1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:19:55 +00:00
openmw-tes3mp/components/esm/loadstat.cpp

43 lines
793 B
C++

#include "loadstat.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "defs.hpp"
#include "util.hpp"
namespace ESM
{
unsigned int Static::sRecordId = REC_STAT;
Static::Static()
: mIsDeleted(false)
{}
void Static::load(ESMReader &esm)
{
mId = esm.getHNString("NAME");
if (mIsDeleted = readDeleSubRecord(esm))
{
return;
}
mModel = esm.getHNString("MODL");
}
void Static::save(ESMWriter &esm) const
{
esm.writeHNCString("NAME", mId);
if (mIsDeleted)
{
writeDeleSubRecord(esm);
return;
}
esm.writeHNCString("MODL", mModel);
}
void Static::blank()
{
mModel.clear();
mIsDeleted = false;
}
}