1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 18:15:33 +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,9 +12,10 @@ 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); MWRender::Animation *anim = MWBase::Environment::get().getWorld()->getAnimation(ptr);
if(anim != NULL)
mActivators.insert(std::make_pair(ptr, CharacterController(ptr, anim, CharState_Idle, true))); mActivators.insert(std::make_pair(ptr, CharacterController(ptr, anim, CharState_Idle, true)));
} }

View file

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