mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
Do not respawn container if player did not touch it
This commit is contained in:
parent
c01153569d
commit
29cfd2c583
@ -89,6 +89,10 @@ namespace MWClass
|
|||||||
ptr.get<ESM::Container>();
|
ptr.get<ESM::Container>();
|
||||||
if (ref->mBase->mFlags & ESM::Container::Respawn)
|
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);
|
MWBase::Environment::get().getWorld()->removeContainerScripts(ptr);
|
||||||
ptr.getRefData().setCustomData(nullptr);
|
ptr.getRefData().setCustomData(nullptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user