1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 03:45:32 +00:00

Only register activators that have a MWRender::Animation object

This commit is contained in:
Chris Robinson 2013-01-29 01:08:52 -08:00
parent 99efe4e494
commit d4ddaa3d95
2 changed files with 4 additions and 3 deletions

View file

@ -12,10 +12,11 @@ Activators::Activators()
{
}
void Activators::addActivator (const MWWorld::Ptr& ptr)
void Activators::addActivator(const MWWorld::Ptr& ptr)
{
MWRender::Animation *anim = MWBase::Environment::get().getWorld()->getAnimation(ptr);
mActivators.insert(std::make_pair(ptr, CharacterController(ptr, anim, CharState_Idle, true)));
if(anim != NULL)
mActivators.insert(std::make_pair(ptr, CharacterController(ptr, anim, CharState_Idle, true)));
}
void Activators::removeActivator (const MWWorld::Ptr& ptr)

View file

@ -23,7 +23,7 @@ namespace MWMechanics
Activators();
void addActivator (const MWWorld::Ptr& ptr);
///< Register an activator
///< Register an animated activator
void removeActivator (const MWWorld::Ptr& ptr);
///< Deregister an activator