Make flying creatures fall when paralyzed (Fixes #1494)

deque
scrawl 11 years ago
parent 865f4648b0
commit 9eb8addc70

@ -1395,6 +1395,9 @@ void CharacterController::update(float duration)
if (mMovementAnimVelocity == 0)
world->queueMovement(mPtr, vec);
}
else
// We must always queue movement, even if there is none, to apply gravity.
world->queueMovement(mPtr, Ogre::Vector3(0.0f));
movement = vec;
cls.getMovementSettings(mPtr).mPosition[0] = cls.getMovementSettings(mPtr).mPosition[1] = cls.getMovementSettings(mPtr).mPosition[2] = 0;

@ -1764,6 +1764,9 @@ namespace MWWorld
bool
World::isFlying(const MWWorld::Ptr &ptr) const
{
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
bool isParalyzed = (stats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0);
if(!ptr.getClass().isActor())
return false;
@ -1771,9 +1774,8 @@ namespace MWWorld
return false;
if (ptr.getClass().canFly(ptr))
return true;
return !isParalyzed;
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
if(stats.getMagicEffects().get(ESM::MagicEffect::Levitate).mMagnitude > 0
&& isLevitationEnabled())
return true;

Loading…
Cancel
Save