mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Merge branch 'dont_remove_items_from_saves' into 'master'
Fix #7491. Alternative to !3258 Closes #7491 See merge request OpenMW/openmw!3266
This commit is contained in:
commit
a16a5003d8
@ -277,9 +277,17 @@ namespace
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(Debug::Warning) << "Warning: Dropping reference to " << state.mRef.mRefID
|
// Note: we preserve RefNum when picking up or dropping an item. So if this RefNum is not found
|
||||||
<< " (invalid content file link)";
|
// in this cell in content files, it doesn't mean that the instance is invalid.
|
||||||
return;
|
// But non-storable item are always stored in saves together with their original cell.
|
||||||
|
// If a non-storable item references a content file, but is not found in this content file,
|
||||||
|
// we should drop it.
|
||||||
|
if (!MWWorld::ContainerStore::isStorableType<T>())
|
||||||
|
{
|
||||||
|
Log(Debug::Warning) << "Warning: Dropping reference to " << state.mRef.mRefID
|
||||||
|
<< " (invalid content file link)";
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// new reference
|
// new reference
|
||||||
|
@ -99,6 +99,19 @@ namespace MWWorld
|
|||||||
|
|
||||||
static const ESM::RefId sGoldId;
|
static const ESM::RefId sGoldId;
|
||||||
|
|
||||||
|
static constexpr bool isStorableType(unsigned int t)
|
||||||
|
{
|
||||||
|
return t == ESM::Potion::sRecordId || t == ESM::Apparatus::sRecordId || t == ESM::Armor::sRecordId
|
||||||
|
|| t == ESM::Book::sRecordId || t == ESM::Clothing::sRecordId || t == ESM::Ingredient::sRecordId
|
||||||
|
|| t == ESM::Light::sRecordId || t == ESM::Lockpick::sRecordId || t == ESM::Miscellaneous::sRecordId
|
||||||
|
|| t == ESM::Probe::sRecordId || t == ESM::Repair::sRecordId || t == ESM::Weapon::sRecordId;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
static constexpr bool isStorableType()
|
||||||
|
{
|
||||||
|
return isStorableType(T::sRecordId);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ContainerStoreListener* mListener;
|
ContainerStoreListener* mListener;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user