1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-31 01:20:23 +00:00
OpenMW/components/esm/loadstat.cpp
Stanislav Bas 80074f90bf Set Deleted flag to false when initializing ESM records
(cherry picked from commit 7ecb54a776a298bee470397c40ce64945a2b0174)
2015-12-05 07:08:50 +11:00

44 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;
}
}