Limit position updates to those that care

This commit is contained in:
Michael Cook (mackal) 2017-07-22 17:35:42 -04:00
parent da660b461f
commit 51c9cec35a
2 changed files with 16 additions and 2 deletions

View File

@ -583,14 +583,27 @@ bool Aura::Process()
if (movement_type == AuraMovement::Follow && GetPosition() != owner->GetPosition() && movement_timer.Check()) {
m_Position = owner->GetPosition();
SendPositionUpdate();
auto app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;
MakeSpawnUpdate(spu);
auto it = spawned_for.begin();
while (it != spawned_for.end()) {
auto client = entity_list.GetClientByID(*it);
if (client) {
client->QueuePacket(app);
++it;
} else {
it = spawned_for.erase(it);
}
}
}
// TODO: waypoints?
if (!process_timer.Check())
return true;
ProcessSpawns(); // bit of a hack
if (spawn_type != AuraSpawns::Noone)
ProcessSpawns(); // bit of a hack
if (process_func)
process_func(*this, owner);

View File

@ -41,6 +41,7 @@ enum class AuraMovement {
class Aura : public NPC
{
// NOTE: We may have to override more virtual functions if they're causing issues
public:
Aura(NPCType *type_data, Mob *owner, AuraRecord &record);
~Aura() { };