[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::CreatureStats *ptrCreatureStats = &ptr.getClass().getCreatureStats(ptr);
MWMechanics::DynamicStat<float> value; 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) for (int i = 0; i < 3; ++i)
{ {
value.readState(creatureStats.mDynamic[i]); value.readState(creatureStats.mDynamic[i]);

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

Loading…
Cancel
Save