|
|
@ -13,8 +13,12 @@ namespace ESM
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned int Dialogue::sRecordId = REC_DIAL;
|
|
|
|
unsigned int Dialogue::sRecordId = REC_DIAL;
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::load(ESMReader &esm)
|
|
|
|
Dialogue::Dialogue()
|
|
|
|
{
|
|
|
|
: mIsDeleted(false)
|
|
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::load(ESMReader &esm)
|
|
|
|
|
|
|
|
{
|
|
|
|
mIsDeleted = false;
|
|
|
|
mIsDeleted = false;
|
|
|
|
|
|
|
|
|
|
|
|
mId = esm.getHNString("NAME");
|
|
|
|
mId = esm.getHNString("NAME");
|
|
|
@ -31,10 +35,10 @@ void Dialogue::load(ESMReader &esm)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
esm.fail("Unknown sub record size");
|
|
|
|
esm.fail("Unknown sub record size");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::save(ESMWriter &esm) const
|
|
|
|
void Dialogue::save(ESMWriter &esm) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
esm.writeHNCString("NAME", mId);
|
|
|
|
esm.writeHNCString("NAME", mId);
|
|
|
|
if (mIsDeleted)
|
|
|
|
if (mIsDeleted)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -45,15 +49,15 @@ void Dialogue::save(ESMWriter &esm) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
esm.writeHNT("DATA", mType);
|
|
|
|
esm.writeHNT("DATA", mType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::blank()
|
|
|
|
void Dialogue::blank()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mInfo.clear();
|
|
|
|
mInfo.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::readInfo(ESMReader &esm, bool merge)
|
|
|
|
void Dialogue::readInfo(ESMReader &esm, bool merge)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const std::string& id = esm.getHNOString("INAM");
|
|
|
|
const std::string& id = esm.getHNOString("INAM");
|
|
|
|
|
|
|
|
|
|
|
|
if (!merge || mInfo.empty())
|
|
|
|
if (!merge || mInfo.empty())
|
|
|
@ -121,10 +125,10 @@ void Dialogue::readInfo(ESMReader &esm, bool merge)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::cerr << "Failed to insert info " << id << std::endl;
|
|
|
|
std::cerr << "Failed to insert info " << id << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dialogue::clearDeletedInfos()
|
|
|
|
void Dialogue::clearDeletedInfos()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (InfoContainer::iterator it = mInfo.begin(); it != mInfo.end(); )
|
|
|
|
for (InfoContainer::iterator it = mInfo.begin(); it != mInfo.end(); )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (it->mQuestStatus == DialInfo::QS_Deleted)
|
|
|
|
if (it->mQuestStatus == DialInfo::QS_Deleted)
|
|
|
@ -132,6 +136,5 @@ void Dialogue::clearDeletedInfos()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
++it;
|
|
|
|
++it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|