1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-26 20:37:25 +00:00

Do not respawn container if player did not touch it

This commit is contained in:
Andrei Kortunov 2019-05-04 14:09:09 +04:00
parent c01153569d
commit 29cfd2c583

View File

@ -89,6 +89,10 @@ namespace MWClass
ptr.get<ESM::Container>();
if (ref->mBase->mFlags & ESM::Container::Respawn)
{
// Container was not touched, there is no need to modify its content.
if (ptr.getRefData().getCustomData() == nullptr)
return;
MWBase::Environment::get().getWorld()->removeContainerScripts(ptr);
ptr.getRefData().setCustomData(nullptr);
}