|
|
|
@ -1560,9 +1560,19 @@ namespace MWWorld
|
|
|
|
|
bool
|
|
|
|
|
World::isFlying(const MWWorld::Ptr &ptr) const
|
|
|
|
|
{
|
|
|
|
|
const MWWorld::Class &cls = MWWorld::Class::get(ptr);
|
|
|
|
|
if(cls.isActor() && cls.getCreatureStats(ptr).getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Levitate)).mMagnitude > 0)
|
|
|
|
|
if(!ptr.getClass().isActor())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
|
|
|
|
if(stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Levitate)).mMagnitude > 0)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// TODO: Check if flying creature
|
|
|
|
|
|
|
|
|
|
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(ptr.getRefData().getHandle());
|
|
|
|
|
if(!actor || !actor->getCollisionMode())
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|