From 7432771ac7373069da5e8e26b3ab1bb6b0748971 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 16 Aug 2014 00:51:02 +0200 Subject: [PATCH] For non-active torches set the particle system speed factor to zero instead of destroying it (Fixes #1811) --- apps/openmw/mwrender/animation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 7a5a458324..0547051a71 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1430,9 +1430,12 @@ void ObjectAnimation::removeParticles() { for (unsigned int i=0; imParticles.size(); ++i) { - mObjectRoot->mSceneMgr->destroyParticleSystem(mObjectRoot->mParticles[i]); + // Don't destroyParticleSystem, the ParticleSystemController is still holding a pointer to it. + // Don't setVisible, this could conflict with a VisController. + // The following will remove all spawned particles, then set the speed factor to zero so that no new ones will be spawned. + mObjectRoot->mParticles[i]->setSpeedFactor(0.f); + mObjectRoot->mParticles[i]->clear(); } - mObjectRoot->mParticles.clear(); }