mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
40 lines
708 B
C++
40 lines
708 B
C++
#include "loaddial.hpp"
|
|
|
|
#include "esm_reader.hpp"
|
|
#include "esm_writer.hpp"
|
|
|
|
namespace ESM
|
|
{
|
|
|
|
void Dialogue::load(ESMReader &esm)
|
|
{
|
|
esm.getSubNameIs("DATA");
|
|
esm.getSubHeader();
|
|
int si = esm.getSubSize();
|
|
if (si == 1)
|
|
esm.getT(mType);
|
|
else if (si == 4)
|
|
{
|
|
// These are just markers, their values are not used.
|
|
int i;
|
|
esm.getT(i);
|
|
esm.getHNT(i, "DELE");
|
|
mType = Deleted;
|
|
}
|
|
else
|
|
esm.fail("Unknown sub record size");
|
|
}
|
|
|
|
void Dialogue::save(ESMWriter &esm)
|
|
{
|
|
if (mType != Deleted)
|
|
esm.writeHNT("DATA", mType);
|
|
else
|
|
{
|
|
esm.writeHNT("DATA", (int)1);
|
|
esm.writeHNT("DELE", (int)1);
|
|
}
|
|
}
|
|
|
|
}
|