1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-01 10:09:41 +00:00

[Client] Disable collision for actors loaded as dead from server

This commit is contained in:
David Cernat 2017-05-31 07:52:45 +03:00
parent 906b263a2d
commit 97bf0252a4

View file

@ -1,6 +1,8 @@
#include <components/esm/cellid.hpp> #include <components/esm/cellid.hpp>
#include <components/openmw-mp/Log.hpp> #include <components/openmw-mp/Log.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/livecellref.hpp" #include "../mwworld/livecellref.hpp"
#include "../mwworld/worldimp.hpp" #include "../mwworld/worldimp.hpp"
@ -190,8 +192,13 @@ void Cell::readStatsDynamic(ActorList& actorList)
// received from the server still gets set // received from the server still gets set
actor->setStatsDynamic(); actor->setStatsDynamic();
// Actors loaded as dead from the server need special handling to skip their death animations
// and disable their collision
if (actor->creatureStats.mDynamic[0].mCurrent < 1) if (actor->creatureStats.mDynamic[0].mCurrent < 1)
{
actor->getPtr().getClass().getCreatureStats(actor->getPtr()).setDeathAnimationFinished(true); actor->getPtr().getClass().getCreatureStats(actor->getPtr()).setDeathAnimationFinished(true);
MWBase::Environment::get().getWorld()->enableActorCollision(actor->getPtr(), false);
}
} }
} }
} }