|
|
|
@ -52,7 +52,7 @@ namespace
|
|
|
|
|
iter!=collection.mList.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
if (iter->mData.getCount()==0 && iter->mRef.mRefNum.mContentFile==-1)
|
|
|
|
|
continue; // deleted file that did not came from a content file -> ignore
|
|
|
|
|
continue; // deleted reference that did not come from a content file -> ignore
|
|
|
|
|
|
|
|
|
|
RecordType state;
|
|
|
|
|
iter->save (state);
|
|
|
|
@ -72,13 +72,17 @@ namespace
|
|
|
|
|
RecordType state;
|
|
|
|
|
state.load (reader);
|
|
|
|
|
|
|
|
|
|
std::map<int, int>::const_iterator iter =
|
|
|
|
|
contentFileMap.find (state.mRef.mRefNum.mContentFile);
|
|
|
|
|
// If the reference came from a content file, make sure this content file is loaded
|
|
|
|
|
if (state.mRef.mRefNum.mContentFile != -1)
|
|
|
|
|
{
|
|
|
|
|
std::map<int, int>::const_iterator iter =
|
|
|
|
|
contentFileMap.find (state.mRef.mRefNum.mContentFile);
|
|
|
|
|
|
|
|
|
|
if (iter==contentFileMap.end())
|
|
|
|
|
return; // content file has been removed -> skip
|
|
|
|
|
if (iter==contentFileMap.end())
|
|
|
|
|
return; // content file has been removed -> skip
|
|
|
|
|
|
|
|
|
|
state.mRef.mRefNum.mContentFile = iter->second;
|
|
|
|
|
state.mRef.mRefNum.mContentFile = iter->second;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!MWWorld::LiveCellRef<T>::checkState (state))
|
|
|
|
|
return; // not valid anymore with current content files -> skip
|
|
|
|
|