mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Avoid double assignment on info saving
This commit is contained in:
parent
0d523c3793
commit
c8402c0b14
@ -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…
x
Reference in New Issue
Block a user