From 693d3cea4a0feac8fe765da5db03d4ad291df3b7 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 15 Jun 2016 19:38:04 +0200 Subject: [PATCH] Float to surface fix --- apps/openmw/mwmechanics/character.cpp | 2 +- apps/openmw/mwphysics/physicssystem.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 4052a37b7..c20153206 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -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 diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index d1dca5f3f..95de8430d 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -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(); }