1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

reimplemented add and appendBlankRecord via insertRecord

This commit is contained in:
Marc Zinnschlag 2013-10-27 14:13:10 +01:00
parent 525d6fadec
commit 9a80e11182

View File

@ -152,8 +152,7 @@ namespace CSMWorld
record2.mState = Record<ESXRecordT>::State_ModifiedOnly; record2.mState = Record<ESXRecordT>::State_ModifiedOnly;
record2.mModified = record; record2.mModified = record;
mRecords.push_back (record2); insertRecord (record2, mRecords.size());
mIndex.insert (std::make_pair (Misc::StringUtils::lowerCase (id), mRecords.size()-1));
} }
else else
{ {
@ -270,7 +269,12 @@ namespace CSMWorld
ESXRecordT record; ESXRecordT record;
IdAccessorT().getId (record) = id; IdAccessorT().getId (record) = id;
record.blank(); record.blank();
add (record);
Record<ESXRecordT> record2;
record2.mState = Record<ESXRecordT>::State_ModifiedOnly;
record2.mModified = record;
insertRecord (record2, mRecords.size(), type);
} }
template<typename ESXRecordT, typename IdAccessorT> template<typename ESXRecordT, typename IdAccessorT>