mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 21:39:41 +00:00
Float to surface fix
This commit is contained in:
parent
b5cb11ff07
commit
693d3cea4a
2 changed files with 3 additions and 3 deletions
|
@ -1938,7 +1938,7 @@ void CharacterController::update(float duration)
|
||||||
if (mSkipAnim)
|
if (mSkipAnim)
|
||||||
mAnimation->updateEffects(duration);
|
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;
|
moved.z() = 1.0;
|
||||||
|
|
||||||
// Update movement
|
// Update movement
|
||||||
|
|
|
@ -280,9 +280,9 @@ namespace MWPhysics
|
||||||
{
|
{
|
||||||
velocity = (osg::Quat(refpos.rot[2], osg::Vec3f(0, 0, -1))) * movement;
|
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;
|
inertia = velocity;
|
||||||
if(!physicActor->getOnGround())
|
else if(!physicActor->getOnGround())
|
||||||
{
|
{
|
||||||
velocity = velocity + physicActor->getInertialForce();
|
velocity = velocity + physicActor->getInertialForce();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue