[Client] Send all data for newly initialized LocalActors at least once

master
David Cernat 6 years ago
parent e70fd2cf3a
commit 433a69a588

@ -82,8 +82,10 @@ void Cell::updateLocal(bool forceUpdate)
} }
else else
{ {
// Forcibly update this local actor if its data has never been sent before;
// otherwise, use the current forceUpdate value
if (actor->getPtr().getRefData().isEnabled()) if (actor->getPtr().getRefData().isEnabled())
actor->update(forceUpdate); actor->update(actor->hasSentData ? forceUpdate : true);
++it; ++it;
} }

@ -22,6 +22,7 @@ using namespace std;
LocalActor::LocalActor() LocalActor::LocalActor()
{ {
hasSentData = false;
posWasChanged = false; posWasChanged = false;
equipmentChanged = false; equipmentChanged = false;
@ -61,6 +62,8 @@ void LocalActor::update(bool forceUpdate)
updateSpeech(); updateSpeech();
updateAttack(); updateAttack();
} }
hasSentData = true;
} }
void LocalActor::updateCell() void LocalActor::updateCell()

@ -28,6 +28,7 @@ namespace mwmp
MWWorld::Ptr getPtr(); MWWorld::Ptr getPtr();
void setPtr(const MWWorld::Ptr& newPtr); void setPtr(const MWWorld::Ptr& newPtr);
bool hasSentData;
bool wasDead; bool wasDead;
private: private:

Loading…
Cancel
Save