diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index f27f8bcb1..f73223e94 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -683,6 +683,20 @@ CharacterState CharacterController::chooseRandomDeathState() const void CharacterController::playRandomDeath(float startpoint) { + /* + Start of tes3mp addition + + If this is a LocalActor or DedicatedActor whose death animation is supposed to be finished, + set the start point to the animation's end + */ + if (mPtr.getClass().getCreatureStats(mPtr).isDeathAnimationFinished() && (mwmp::Main::get().getCellController()->isLocalActor(mPtr) || mwmp::Main::get().getCellController()->isDedicatedActor(mPtr))) + { + startpoint = 1.F; + } + /* + End of tes3mp addition + */ + if (mPtr == getPlayer()) { // The first-person animations do not include death, so we need to diff --git a/apps/openmw/mwmp/Cell.cpp b/apps/openmw/mwmp/Cell.cpp index 679379d59..5253a541a 100644 --- a/apps/openmw/mwmp/Cell.cpp +++ b/apps/openmw/mwmp/Cell.cpp @@ -188,6 +188,9 @@ void Cell::readStatsDynamic(ActorList& actorList) // That way, if this actor is about to become a LocalActor, initial data about it // received from the server still gets set actor->setStatsDynamic(); + + if (actor->creatureStats.mDynamic[0].mCurrent < 1) + actor->getPtr().getClass().getCreatureStats(actor->getPtr()).setDeathAnimationFinished(true); } } }