1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 10:53:51 +00:00

Merge pull request #2728 from akortunov/swimfix

Trace down dead persistent actors underwater
This commit is contained in:
Alexei Dobrohotov 2020-03-23 21:00:42 +03:00 committed by GitHub
commit 8d02b619fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1424,7 +1424,9 @@ namespace MWWorld
pos.z() += 20; // place slightly above. will snap down to ground with code below 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); osg::Vec3f traced = mPhysics->traceDown(ptr, pos, Constants::CellSizeInUnits);
if (traced.z() < pos.z()) if (traced.z() < pos.z())