[Client] Resurrect DedicatedActors that aren't supposed to be dead

0.6.1
David Cernat 8 years ago
parent 8b4e167efe
commit b745a33f18

@ -152,6 +152,10 @@ void DedicatedActor::setStatsDynamic()
MWMechanics::CreatureStats *ptrCreatureStats = &ptr.getClass().getCreatureStats(ptr);
MWMechanics::DynamicStat<float> value;
// Resurrect this Actor if it's not supposed to be dead according to its authority
if (creatureStats.mDynamic[0].mCurrent > 0)
ptrCreatureStats->resurrect();
for (int i = 0; i < 3; ++i)
{
value.readState(creatureStats.mDynamic[i]);

@ -64,12 +64,11 @@ void DedicatedPlayer::update(float dt)
return;
}
value.readState(creatureStats.mDynamic[0]);
ptrCreatureStats->setHealth(value);
value.readState(creatureStats.mDynamic[1]);
ptrCreatureStats->setMagicka(value);
value.readState(creatureStats.mDynamic[2]);
ptrCreatureStats->setFatigue(value);
for (int i = 0; i < 3; ++i)
{
value.readState(creatureStats.mDynamic[i]);
ptrCreatureStats->setDynamic(i, value);
}
if (ptrCreatureStats->isDead())
ptrCreatureStats->resurrect();
@ -84,7 +83,6 @@ void DedicatedPlayer::update(float dt)
ptrCreatureStats->setAiSetting(MWMechanics::CreatureStats::AI_Flee, 0);
ptrCreatureStats->setAiSetting(MWMechanics::CreatureStats::AI_Hello, 0);
//ptrNpcStats->setBaseDisposition(255);
move(dt);
updateAnimFlags();
}

Loading…
Cancel
Save