forked from teamnwah/openmw-tes3coop
Use the object's class to check if it's an actor
This commit is contained in:
parent
acae815cd2
commit
10d04c928c
1 changed files with 12 additions and 12 deletions
|
@ -178,10 +178,10 @@ namespace MWMechanics
|
|||
|
||||
void MechanicsManager::add(const MWWorld::Ptr& ptr)
|
||||
{
|
||||
if(ptr.getTypeName() == typeid(ESM::Activator).name())
|
||||
mActivators.addActivator(ptr);
|
||||
else
|
||||
if(MWWorld::Class::get(ptr).isActor())
|
||||
mActors.addActor(ptr);
|
||||
else
|
||||
mActivators.addActivator(ptr);
|
||||
}
|
||||
|
||||
void MechanicsManager::remove(const MWWorld::Ptr& ptr)
|
||||
|
@ -194,10 +194,10 @@ namespace MWMechanics
|
|||
|
||||
void MechanicsManager::updateCell(const MWWorld::Ptr &old, const MWWorld::Ptr &ptr)
|
||||
{
|
||||
if(ptr.getTypeName() == typeid(ESM::Activator).name())
|
||||
mActivators.updateActivator(old, ptr);
|
||||
else
|
||||
if(MWWorld::Class::get(ptr).isActor())
|
||||
mActors.updateActor(old, ptr);
|
||||
else
|
||||
mActivators.updateActivator(old, ptr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -656,17 +656,17 @@ namespace MWMechanics
|
|||
|
||||
void MechanicsManager::playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number)
|
||||
{
|
||||
if(ptr.getTypeName() == typeid(ESM::Activator).name())
|
||||
mActivators.playAnimationGroup(ptr, groupName, mode, number);
|
||||
else
|
||||
if(MWWorld::Class::get(ptr).isActor())
|
||||
mActors.playAnimationGroup(ptr, groupName, mode, number);
|
||||
else
|
||||
mActivators.playAnimationGroup(ptr, groupName, mode, number);
|
||||
}
|
||||
void MechanicsManager::skipAnimation(const MWWorld::Ptr& ptr)
|
||||
{
|
||||
if(ptr.getTypeName() == typeid(ESM::Activator).name())
|
||||
mActivators.skipAnimation(ptr);
|
||||
else
|
||||
if(MWWorld::Class::get(ptr).isActor())
|
||||
mActors.skipAnimation(ptr);
|
||||
else
|
||||
mActivators.skipAnimation(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue