mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-28 14:53:58 +00:00
Non-colliding objects are considered flying
This commit is contained in:
parent
602be9bbe7
commit
c855ab65cf
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user