Update player markers only when getting a position packet

coverity_scan^2
David Cernat 8 years ago
parent 7f98cddfdf
commit d93e66207e

@ -220,8 +220,6 @@ void DedicatedPlayer::Move(float dt)
void Players::Update(float dt)
{
static float timer = 0;
timer += dt;
for (std::map <uint64_t, DedicatedPlayer *>::iterator it = players.begin(); it != players.end(); it++)
{
DedicatedPlayer *pl = it->second;
@ -262,12 +260,7 @@ void Players::Update(float dt)
ptrNpcStats->setBaseDisposition(255);
pl->Move(dt);
pl->UpdateDrawState();
if (timer >= 0.2) // call every 200 msec
pl->updateMarker();
}
if (timer >= 0.2)
timer = 0;
}
void DedicatedPlayer::UpdatePtr(MWWorld::Ptr newPtr)

@ -243,7 +243,10 @@ void Networking::ProcessPlayerPacket(RakNet::Packet *packet)
getLocalPlayer()->updatePosition(true);
}
else if (pl != 0)
{
myPacket->Packet(&bsIn, pl, false);
pl->updateMarker();
}
break;
}
case ID_USER_MYID:

Loading…
Cancel
Save