Avoid double assignment on info saving

depth-refraction
elsid 2 years ago
parent 0d523c3793
commit c8402c0b14
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -190,17 +190,16 @@ void CSMDoc::WriteDialogueCollectionStage::perform(int stage, Messages& messages
ESM::DialInfo info = record.get(); ESM::DialInfo info = record.get();
info.mId = record.get().mOriginalId; info.mId = record.get().mOriginalId;
info.mPrev = ESM::RefId(); if (iter == infos.begin())
if (iter != infos.begin()) info.mPrev = ESM::RefId();
{ else
const auto prev = std::prev(iter); info.mPrev = (*std::prev(iter))->get().mOriginalId;
info.mPrev = (*prev)->get().mOriginalId;
}
const auto next = std::next(iter); const auto next = std::next(iter);
info.mNext = ESM::RefId(); if (next == infos.end())
if (next != infos.end()) info.mNext = ESM::RefId();
else
info.mNext = (*next)->get().mOriginalId; info.mNext = (*next)->get().mOriginalId;
writer.startRecord(info.sRecordId); writer.startRecord(info.sRecordId);

Loading…
Cancel
Save