mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 14:45:35 +00:00
Stop trying to save ESM4 objects in omwsave files because they currently can not be saved and only lead to errors in logs.
This commit is contained in:
parent
62b787a214
commit
e51dfca488
1 changed files with 23 additions and 22 deletions
|
@ -161,31 +161,32 @@ namespace
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void writeReferenceCollection(ESM::ESMWriter& writer, const MWWorld::CellRefList<T>& collection)
|
void writeReferenceCollection(ESM::ESMWriter& writer, const MWWorld::CellRefList<T>& collection)
|
||||||
{
|
{
|
||||||
if (!collection.mList.empty())
|
// references
|
||||||
|
for (const MWWorld::LiveCellRef<T>& liveCellRef : collection.mList)
|
||||||
{
|
{
|
||||||
// references
|
if (ESM::isESM4Rec(T::sRecordId))
|
||||||
for (typename MWWorld::CellRefList<T>::List::const_iterator iter(collection.mList.begin());
|
|
||||||
iter != collection.mList.end(); ++iter)
|
|
||||||
{
|
{
|
||||||
if (!iter->mData.hasChanged() && !iter->mRef.hasChanged() && iter->mRef.hasContentFile())
|
// TODO: Implement loading/saving of REFR4 and ACHR4 with ESM3 reader/writer.
|
||||||
{
|
continue;
|
||||||
// Reference that came from a content file and has not been changed -> ignore
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (iter->mData.getCount() == 0 && !iter->mRef.hasContentFile())
|
|
||||||
{
|
|
||||||
// Deleted reference that did not come from a content file -> ignore
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
using StateType = typename RecordToState<T>::StateType;
|
|
||||||
StateType state;
|
|
||||||
iter->save(state);
|
|
||||||
|
|
||||||
// recordId currently unused
|
|
||||||
writer.writeHNT("OBJE", collection.mList.front().mBase->sRecordId);
|
|
||||||
|
|
||||||
state.save(writer);
|
|
||||||
}
|
}
|
||||||
|
if (!liveCellRef.mData.hasChanged() && !liveCellRef.mRef.hasChanged() && liveCellRef.mRef.hasContentFile())
|
||||||
|
{
|
||||||
|
// Reference that came from a content file and has not been changed -> ignore
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (liveCellRef.mData.getCount() == 0 && !liveCellRef.mRef.hasContentFile())
|
||||||
|
{
|
||||||
|
// Deleted reference that did not come from a content file -> ignore
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
using StateType = typename RecordToState<T>::StateType;
|
||||||
|
StateType state;
|
||||||
|
liveCellRef.save(state);
|
||||||
|
|
||||||
|
// recordId currently unused
|
||||||
|
writer.writeHNT("OBJE", collection.mList.front().mBase->sRecordId);
|
||||||
|
|
||||||
|
state.save(writer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue