[Client] Don't play death animations for NPCs saved as dead on server

0.6.1
David Cernat 8 years ago
parent da22639620
commit 271594f0ee

@ -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

@ -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);
}
}
}

Loading…
Cancel
Save