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