mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 02:15:32 +00:00
Add NAME and DELE handling to Global record
This commit is contained in:
parent
30b42bf4c0
commit
09a3358017
2 changed files with 18 additions and 0 deletions
|
@ -1,6 +1,9 @@
|
||||||
#include "loadglob.hpp"
|
#include "loadglob.hpp"
|
||||||
|
|
||||||
|
#include "esmreader.hpp"
|
||||||
|
#include "esmwriter.hpp"
|
||||||
#include "defs.hpp"
|
#include "defs.hpp"
|
||||||
|
#include "util.hpp"
|
||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
@ -8,11 +11,24 @@ namespace ESM
|
||||||
|
|
||||||
void Global::load (ESMReader &esm)
|
void Global::load (ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mId = esm.getHNString("NAME");
|
||||||
|
if (mIsDeleted = readDeleSubRecord(esm))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mValue.read (esm, ESM::Variant::Format_Global);
|
mValue.read (esm, ESM::Variant::Format_Global);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Global::save (ESMWriter &esm) const
|
void Global::save (ESMWriter &esm) const
|
||||||
{
|
{
|
||||||
|
esm.writeHNCString("NAME", mId);
|
||||||
|
if (mIsDeleted)
|
||||||
|
{
|
||||||
|
writeDeleSubRecord(esm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mValue.write (esm, ESM::Variant::Format_Global);
|
mValue.write (esm, ESM::Variant::Format_Global);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ struct Global
|
||||||
std::string mId;
|
std::string mId;
|
||||||
Variant mValue;
|
Variant mValue;
|
||||||
|
|
||||||
|
bool mIsDeleted;
|
||||||
|
|
||||||
void load(ESMReader &esm);
|
void load(ESMReader &esm);
|
||||||
void save(ESMWriter &esm) const;
|
void save(ESMWriter &esm) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue