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

Make sure effects are destroyed with the animation

This commit is contained in:
scrawl 2013-11-12 02:13:36 +01:00
parent eccb8f38ba
commit 0dab7031c0
3 changed files with 4 additions and 2 deletions

View File

@ -445,7 +445,7 @@ namespace MWClass
skillUsageSucceeded(ptr, weapskill, 0);
// Apply "On hit" enchanted weapons
std::string enchantmentName = weapon.getClass().getEnchantment(weapon);
std::string enchantmentName = !weapon.isEmpty() ? weapon.getClass().getEnchantment(weapon) : "";
if (!enchantmentName.empty())
{
const ESM::Enchantment* enchantment = MWBase::Environment::get().getWorld()->getStore().get<ESM::Enchantment>().find(

View File

@ -87,6 +87,9 @@ Animation::Animation(const MWWorld::Ptr &ptr, Ogre::SceneNode *node)
Animation::~Animation()
{
for (std::vector<NifOgre::ObjectList>::iterator it = mEffects.begin(); it != mEffects.end(); ++it)
destroyObjectList(mInsert->getCreator(), *it);
mAnimSources.clear();
Ogre::SceneManager *sceneMgr = mInsert->getCreator();

View File

@ -3,7 +3,6 @@
#include <OgreController.h>
#include <OgreVector3.h>
#include <OgreTimer.h>
#include <components/nifogre/ogrenifloader.hpp>