forked from teamnwah/openmw-tes3coop
[Client] Read ActorStatsDynamic packets sent from Lua script cell loads
This commit is contained in:
parent
fbd8e8b3a1
commit
d333c0b484
1 changed files with 14 additions and 1 deletions
|
@ -144,6 +144,8 @@ void Cell::readAnimPlay(ActorList& actorList)
|
||||||
|
|
||||||
void Cell::readStatsDynamic(ActorList& actorList)
|
void Cell::readStatsDynamic(ActorList& actorList)
|
||||||
{
|
{
|
||||||
|
initializeDedicatedActors(actorList);
|
||||||
|
|
||||||
BaseActor baseActor;
|
BaseActor baseActor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList.count; i++)
|
for (unsigned int i = 0; i < actorList.count; i++)
|
||||||
|
@ -155,7 +157,18 @@ void Cell::readStatsDynamic(ActorList& actorList)
|
||||||
{
|
{
|
||||||
DedicatedActor *actor = dedicatedActors[mapIndex];
|
DedicatedActor *actor = dedicatedActors[mapIndex];
|
||||||
actor->creatureStats = baseActor.creatureStats;
|
actor->creatureStats = baseActor.creatureStats;
|
||||||
actor->hasStatsDynamicData = true;
|
|
||||||
|
if (!actor->hasStatsDynamicData)
|
||||||
|
{
|
||||||
|
actor->hasStatsDynamicData = true;
|
||||||
|
|
||||||
|
// If this is our first packet about this actor's dynamic stats, force an update
|
||||||
|
// now instead of waiting for its frame
|
||||||
|
//
|
||||||
|
// That way, if this actor is about to become a LocalActor, initial data about it
|
||||||
|
// received from the server still gets set
|
||||||
|
actor->setStatsDynamic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue