mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 12:09:41 +00:00
Issue #169: Don't continue to run local scripts after the reference the script is attached to has been deleted
This commit is contained in:
parent
f6249c39d5
commit
695452e1a3
1 changed files with 8 additions and 0 deletions
|
@ -574,6 +574,14 @@ namespace MWWorld
|
||||||
mEnvironment.mSoundManager->stopSound3D (ptr);
|
mEnvironment.mSoundManager->stopSound3D (ptr);
|
||||||
|
|
||||||
mPhysics->removeObject (ptr.getRefData().getHandle());
|
mPhysics->removeObject (ptr.getRefData().getHandle());
|
||||||
|
|
||||||
|
for (ScriptList::iterator iter = mLocalScripts.begin(); iter!=mLocalScripts.end();
|
||||||
|
++iter)
|
||||||
|
if (ptr==iter->second)
|
||||||
|
{
|
||||||
|
mLocalScripts.erase (iter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render->deleteObject (ptr.getRefData().getHandle());
|
render->deleteObject (ptr.getRefData().getHandle());
|
||||||
|
|
Loading…
Reference in a new issue