Float to surface fix

coverity_scan^2
scrawl 9 years ago
parent b5cb11ff07
commit 693d3cea4a

@ -1938,7 +1938,7 @@ void CharacterController::update(float duration)
if (mSkipAnim)
mAnimation->updateEffects(duration);
if (mFloatToSurface && cls.isActor() && cls.getCreatureStats(mPtr).isDead())
if (mFloatToSurface && cls.isActor() && cls.getCreatureStats(mPtr).isDead() && cls.canSwim(mPtr))
moved.z() = 1.0;
// Update movement

@ -280,9 +280,9 @@ namespace MWPhysics
{
velocity = (osg::Quat(refpos.rot[2], osg::Vec3f(0, 0, -1))) * movement;
if (velocity.z() > 0.f)
if (velocity.z() > 0.f && physicActor->getOnGround())
inertia = velocity;
if(!physicActor->getOnGround())
else if(!physicActor->getOnGround())
{
velocity = velocity + physicActor->getInertialForce();
}

Loading…
Cancel
Save