diff --git a/apps/openmw/mwmp/Cell.cpp b/apps/openmw/mwmp/Cell.cpp index 4cb8309cf..1dc5a26e0 100644 --- a/apps/openmw/mwmp/Cell.cpp +++ b/apps/openmw/mwmp/Cell.cpp @@ -155,6 +155,7 @@ void Cell::readStatsDynamic(ActorList& actorList) { DedicatedActor *actor = dedicatedActors[mapIndex]; actor->creatureStats = baseActor.creatureStats; + actor->hasStatsDynamicData = true; } } } diff --git a/apps/openmw/mwmp/DedicatedActor.cpp b/apps/openmw/mwmp/DedicatedActor.cpp index 4acc54ea6..700e0f19d 100644 --- a/apps/openmw/mwmp/DedicatedActor.cpp +++ b/apps/openmw/mwmp/DedicatedActor.cpp @@ -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 value; diff --git a/apps/openmw/mwmp/DedicatedActor.hpp b/apps/openmw/mwmp/DedicatedActor.hpp index d2623c543..8dbfd55f1 100644 --- a/apps/openmw/mwmp/DedicatedActor.hpp +++ b/apps/openmw/mwmp/DedicatedActor.hpp @@ -25,6 +25,8 @@ namespace mwmp MWWorld::Ptr getPtr(); void setPtr(const MWWorld::Ptr& newPtr); + bool hasStatsDynamicData; + private: MWWorld::Ptr ptr;