From f0a1434578506727f86c935f72c0be2d3f986044 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 8 Nov 2015 20:58:00 +0100 Subject: [PATCH] Dead actors underwater will float to the surface --- apps/openmw/mwphysics/physicssystem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index 739b0013b..55144afe7 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -288,6 +288,11 @@ namespace MWPhysics velocity = velocity + physicActor->getInertialForce(); } } + + // dead actors underwater will float to the surface + if (ptr.getClass().getCreatureStats(ptr).isDead() && position.z() < swimlevel) + velocity = osg::Vec3f(0,0,1) * 25; + ptr.getClass().getMovementSettings(ptr).mPosition[2] = 0; // Now that we have the effective movement vector, apply wind forces to it