forked from mirror/openmw-tes3mp
Don't create a CharacterController for objects with no animations
This commit is contained in:
parent
fe0cf5be05
commit
cce42b6e9d
3 changed files with 9 additions and 1 deletions
|
@ -29,7 +29,8 @@ void Objects::addObject(const MWWorld::Ptr& ptr)
|
|||
removeObject(ptr);
|
||||
|
||||
MWRender::Animation *anim = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||
if(anim) mObjects.insert(std::make_pair(ptr, new CharacterController(ptr, anim)));
|
||||
if (anim && anim->hasAnimSources())
|
||||
mObjects.insert(std::make_pair(ptr, new CharacterController(ptr, anim)));
|
||||
}
|
||||
|
||||
void Objects::removeObject(const MWWorld::Ptr& ptr)
|
||||
|
|
|
@ -565,6 +565,11 @@ namespace MWRender
|
|||
}
|
||||
}
|
||||
|
||||
bool Animation::hasAnimSources() const
|
||||
{
|
||||
return !mAnimSources.empty();
|
||||
}
|
||||
|
||||
void Animation::clearAnimSources()
|
||||
{
|
||||
mStates.clear();
|
||||
|
|
|
@ -341,6 +341,8 @@ public:
|
|||
Animation(const MWWorld::Ptr &ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem);
|
||||
virtual ~Animation();
|
||||
|
||||
bool hasAnimSources() const;
|
||||
|
||||
MWWorld::ConstPtr getPtr() const;
|
||||
|
||||
/// Set active flag on the object skeleton, if one exists.
|
||||
|
|
Loading…
Reference in a new issue