[Client] Use better check for empty CreatureStats in DedicatedActor

0.6.1
David Cernat 8 years ago
parent 11605bd19a
commit 7dbcfbd3b1

@ -155,6 +155,7 @@ void Cell::readStatsDynamic(ActorList& actorList)
{
DedicatedActor *actor = dedicatedActors[mapIndex];
actor->creatureStats = baseActor.creatureStats;
actor->hasStatsDynamicData = true;
}
}
}

@ -31,8 +31,8 @@ DedicatedActor::DedicatedActor()
creatureStats = new ESM::CreatureStats();
creatureStats->blank();
creatureStats->mDynamic[0].mBase = -1;
hasStatsDynamicData = false;
hasChangedCell = true;
attack.pressed = false;
@ -137,8 +137,8 @@ void DedicatedActor::playSound()
void DedicatedActor::setStatsDynamic()
{
// Only set dynamic stats if they have valid values
if (creatureStats->mDynamic[0].mBase == -1) return;
// Only set dynamic stats if we have received at least one packet about them
if (!hasStatsDynamicData) return;
MWMechanics::CreatureStats *ptrCreatureStats = &ptr.getClass().getCreatureStats(ptr);
MWMechanics::DynamicStat<float> value;

@ -25,6 +25,8 @@ namespace mwmp
MWWorld::Ptr getPtr();
void setPtr(const MWWorld::Ptr& newPtr);
bool hasStatsDynamicData;
private:
MWWorld::Ptr ptr;

Loading…
Cancel
Save