From c855ab65cfbeeaf0ecbb798bf28f29c335af8471 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 21 Aug 2013 07:24:02 -0700 Subject: [PATCH] Non-colliding objects are considered flying --- apps/openmw/mwworld/worldimp.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 474453c721..950f005659 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -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; }