mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
Fix invalid casts
This commit is contained in:
parent
07251f0fa4
commit
e7993ced69
1 changed files with 6 additions and 2 deletions
|
@ -1045,7 +1045,9 @@ void Animation::updateEffects(float duration)
|
|||
NifOgre::ObjectList& objects = it->mObjects;
|
||||
for(size_t i = 0; i < objects.mControllers.size() ;i++)
|
||||
{
|
||||
static_cast<EffectAnimationValue*> (objects.mControllers[i].getSource().get())->addTime(duration);
|
||||
EffectAnimationValue* value = dynamic_cast<EffectAnimationValue*>(objects.mControllers[i].getSource().get());
|
||||
if (value)
|
||||
value->addTime(duration);
|
||||
|
||||
objects.mControllers[i].update();
|
||||
}
|
||||
|
@ -1058,7 +1060,9 @@ void Animation::updateEffects(float duration)
|
|||
float remainder = objects.mControllers[0].getSource()->getValue() - objects.mMaxControllerLength;
|
||||
for(size_t i = 0; i < objects.mControllers.size() ;i++)
|
||||
{
|
||||
static_cast<EffectAnimationValue*> (objects.mControllers[i].getSource().get())->resetTime(remainder);
|
||||
EffectAnimationValue* value = dynamic_cast<EffectAnimationValue*>(objects.mControllers[i].getSource().get());
|
||||
if (value)
|
||||
value->resetTime(remainder);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue