diff --git a/apps/openmw/mwrender/actors.cpp b/apps/openmw/mwrender/actors.cpp index d356d922e5..485e3a7adc 100644 --- a/apps/openmw/mwrender/actors.cpp +++ b/apps/openmw/mwrender/actors.cpp @@ -169,6 +169,7 @@ void Actors::updateObjectCell(const MWWorld::Ptr &ptr) { Animation *anim = iter->second; mAllActors.erase(iter); + anim->updatePtr(ptr); mAllActors[ptr] = anim; } } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 29652ca6a9..39323edac2 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -169,6 +169,11 @@ void Animation::setLooping(bool loop) mLooping = loop; } +void Animation::updatePtr(const MWWorld::Ptr &ptr) +{ + mPtr = ptr; +} + void Animation::calcAnimVelocity() { diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 47bc8c3900..b8323cb895 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -49,7 +49,6 @@ protected: * bone names) are positioned identically. */ void updateSkeletonInstance(const Ogre::SkeletonInstance *skelsrc, Ogre::SkeletonInstance *skel); - /* Updates the animation to the specified time, and returns the movement * vector since the last update or reset. */ Ogre::Vector3 updatePosition(float time); @@ -78,6 +77,8 @@ public: void setController(MWMechanics::CharacterController *controller); + void updatePtr(const MWWorld::Ptr &ptr); + bool hasAnimation(const std::string &anim); // Specifies the axis' to accumulate on. Non-accumulated axis will just