diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 5fb3591ad2..492157993d 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -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().find( diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index d494304d19..6ef51945eb 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -87,6 +87,9 @@ Animation::Animation(const MWWorld::Ptr &ptr, Ogre::SceneNode *node) Animation::~Animation() { + for (std::vector::iterator it = mEffects.begin(); it != mEffects.end(); ++it) + destroyObjectList(mInsert->getCreator(), *it); + mAnimSources.clear(); Ogre::SceneManager *sceneMgr = mInsert->getCreator(); diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index efc7a6a59a..6653b342ff 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -3,7 +3,6 @@ #include #include -#include #include