Some checks to cut down on position sends by about 30%, still need to optimize movement sends

This commit is contained in:
KimLS 2018-10-14 00:02:16 -07:00
parent d0685556e8
commit 94bce44295

View File

@ -277,7 +277,10 @@ public:
return true;
}
mgr->SendCommandToClients(m, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
if (m->IsMoving()) {
m->SetMoving(false);
mgr->SendCommandToClients(m, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
}
return true;
}
@ -467,8 +470,11 @@ void MobMovementManager::StopNavigation(Mob *who) {
return;
}
who->TryFixZ();
SendCommandToClients(who, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
if (who->IsMoving()) {
who->TryFixZ();
who->SetMoving(false);
SendCommandToClients(who, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
}
ent.second.Commands.clear();
}