From d2a2c74e08444ca33a0e3642cb68a333899915a6 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 21 Mar 2020 10:32:47 +0400 Subject: [PATCH] Trace down dead persistent actors underwater (regression #5317) --- apps/openmw/mwworld/worldimp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 7cc7fef652..26eac954b9 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1424,7 +1424,9 @@ namespace MWWorld pos.z() += 20; // place slightly above. will snap down to ground with code below - if (force || !ptr.getClass().isActor() || (!isFlying(ptr) && !isSwimming(ptr) && isActorCollisionEnabled(ptr))) + // We still should trace down dead persistent actors - they do not use the "swimdeath" animation. + bool swims = ptr.getClass().isActor() && isSwimming(ptr) && !(ptr.getClass().isPersistent(ptr) && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()); + if (force || !ptr.getClass().isActor() || (!isFlying(ptr) && !swims && isActorCollisionEnabled(ptr))) { osg::Vec3f traced = mPhysics->traceDown(ptr, pos, Constants::CellSizeInUnits); if (traced.z() < pos.z())