[General] Don't send packets for dead LocalActors, to fix Position spam

0.6.1
David Cernat 8 years ago
parent 5bd95628ce
commit cc559cf8e2

@ -42,12 +42,16 @@ LocalActor::~LocalActor()
void LocalActor::update(bool forceUpdate)
{
updatePosition(forceUpdate);
updateAnimFlags(forceUpdate);
updateAnimPlay();
updateSpeech();
updateStatsDynamic(forceUpdate);
updateAttack();
if (forceUpdate || !creatureStats.mDead)
{
updatePosition(forceUpdate);
updateAnimFlags(forceUpdate);
updateAnimPlay();
updateSpeech();
updateAttack();
}
}
void LocalActor::updateCell()
@ -183,6 +187,8 @@ void LocalActor::updateStatsDynamic(bool forceUpdate)
magicka.writeState(creatureStats.mDynamic[1]);
fatigue.writeState(creatureStats.mDynamic[2]);
creatureStats.mDead = ptrCreatureStats->isDead();
statTimer = 0;
mwmp::Main::get().getNetworking()->getActorList()->addStatsDynamicActor(*this);

@ -54,6 +54,7 @@ namespace mwmp
struct SimpleCreatureStats
{
ESM::StatState<float> mDynamic[3];
bool mDead;
};
}

Loading…
Cancel
Save