1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Fix effects not being removed from scene graph

This commit is contained in:
ζeh Matt 2022-06-10 22:59:01 +03:00
parent f53bc7807a
commit 9559feaa90
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0

View File

@ -66,10 +66,13 @@ void EffectManager::update(float dt)
std::remove_if(
mEffects.begin(),
mEffects.end(),
[dt](Effect& effect)
[dt, this](Effect& effect)
{
effect.mAnimTime->addTime(dt);
return effect.mAnimTime->getTime() >= effect.mMaxControllerLength;
const auto remove = effect.mAnimTime->getTime() >= effect.mMaxControllerLength;
if (remove)
mParentNode->removeChild(effect.mTransform);
return remove;
}),
mEffects.end()
);