Non-colliding objects are considered flying

This commit is contained in:
Chris Robinson 2013-08-21 07:24:02 -07:00
parent 602be9bbe7
commit c855ab65cf

View file

@ -1560,9 +1560,19 @@ namespace MWWorld
bool bool
World::isFlying(const MWWorld::Ptr &ptr) const World::isFlying(const MWWorld::Ptr &ptr) const
{ {
const MWWorld::Class &cls = MWWorld::Class::get(ptr); if(!ptr.getClass().isActor())
if(cls.isActor() && cls.getCreatureStats(ptr).getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Levitate)).mMagnitude > 0) return false;
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
if(stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Levitate)).mMagnitude > 0)
return true; 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; return false;
} }