1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-01 13:36:40 +00:00

Fix saving when only topic info was modified (topic itself unchanged)

This commit is contained in:
cc9cii 2015-10-31 20:42:42 +11:00
parent 7b817ba010
commit 78c735adc6

View file

@ -134,10 +134,21 @@ void CSMDoc::WriteDialogueCollectionStage::perform (int stage, Messages& message
state==CSMWorld::RecordBase::State_ModifiedOnly || state==CSMWorld::RecordBase::State_ModifiedOnly ||
infoModified) infoModified)
{ {
mState.getWriter().startRecord (topic.mModified.sRecordId); if (infoModified && state != CSMWorld::RecordBase::State_Modified
mState.getWriter().writeHNCString ("NAME", topic.mModified.mId); && state != CSMWorld::RecordBase::State_ModifiedOnly)
topic.mModified.save (mState.getWriter()); {
mState.getWriter().endRecord (topic.mModified.sRecordId); mState.getWriter().startRecord (topic.mBase.sRecordId);
mState.getWriter().writeHNCString ("NAME", topic.mBase.mId);
topic.mBase.save (mState.getWriter());
mState.getWriter().endRecord (topic.mBase.sRecordId);
}
else
{
mState.getWriter().startRecord (topic.mModified.sRecordId);
mState.getWriter().writeHNCString ("NAME", topic.mModified.mId);
topic.mModified.save (mState.getWriter());
mState.getWriter().endRecord (topic.mModified.sRecordId);
}
// write modified selected info records // write modified selected info records
for (CSMWorld::InfoCollection::RecordConstIterator iter (range.first); iter!=range.second; for (CSMWorld::InfoCollection::RecordConstIterator iter (range.first); iter!=range.second;