handle deleted records

pull/16/head
Marc Zinnschlag 12 years ago
parent c1cd8305bc
commit dd2b7d5c63

@ -321,14 +321,35 @@ namespace CSMWorld
{
std::string id = reader.getHNOString ("NAME");
/// \todo deal with deleted flag
int index = searchId (id);
if (reader.isNextSub ("DELE"))
{
reader.skipRecord();
if (index==-1)
{
// deleting a record that does not exist
// ignore it for now
/// \todo report the problem to the user
}
else if (base)
{
removeRows (index, 1);
}
else
{
mRecords[index].mState = RecordBase::State_Deleted;
}
}
else
{
ESXRecordT record;
record.mId = id;
record.load (reader);
int index = searchId (id);
if (index==-1)
{
// new record
@ -349,6 +370,7 @@ namespace CSMWorld
record2.setModified (record);
}
}
}
template<typename ESXRecordT>
const RecordBase& IdCollection<ESXRecordT>::getRecord (const std::string& id) const

Loading…
Cancel
Save