|
|
|
@ -125,6 +125,7 @@ CSMDoc::WriteDialogueCollectionStage::WriteDialogueCollectionStage(Document& doc
|
|
|
|
|
|
|
|
|
|
int CSMDoc::WriteDialogueCollectionStage::setup()
|
|
|
|
|
{
|
|
|
|
|
mInfosByTopic = mInfos.getInfosByTopic();
|
|
|
|
|
return mTopics.getSize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -145,9 +146,11 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
|
|
|
|
|
|
|
|
|
// Test, if we need to save anything associated info records.
|
|
|
|
|
bool infoModified = false;
|
|
|
|
|
const auto infos = mInfos.getTopicInfos(topic.get().mId);
|
|
|
|
|
const auto topicInfos = mInfosByTopic.find(topic.get().mId);
|
|
|
|
|
|
|
|
|
|
for (const auto& record : infos)
|
|
|
|
|
if (topicInfos != mInfosByTopic.end())
|
|
|
|
|
{
|
|
|
|
|
for (const auto& record : topicInfos->second)
|
|
|
|
|
{
|
|
|
|
|
if (record->isModified() || record->mState == CSMWorld::RecordBase::State_Deleted)
|
|
|
|
|
{
|
|
|
|
@ -155,6 +158,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (topic.isModified() || infoModified)
|
|
|
|
|
{
|
|
|
|
@ -173,6 +177,10 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// write modified selected info records
|
|
|
|
|
if (topicInfos != mInfosByTopic.end())
|
|
|
|
|
{
|
|
|
|
|
const std::vector<const CSMWorld::Record<CSMWorld::Info>*>& infos = topicInfos->second;
|
|
|
|
|
|
|
|
|
|
for (auto iter = infos.begin(); iter != infos.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
const CSMWorld::Record<CSMWorld::Info>& record = **iter;
|
|
|
|
@ -201,6 +209,7 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMDoc::WriteRefIdCollectionStage::WriteRefIdCollectionStage(Document& document, SavingState& state)
|
|
|
|
|