forked from teamnwah/openmw-tes3coop
[Client] Use better check for empty CreatureStats in DedicatedActor
This commit is contained in:
parent
11605bd19a
commit
7dbcfbd3b1
3 changed files with 6 additions and 3 deletions
|
@ -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…
Reference in a new issue