From 7edc89160543ca30a5efd2f2a53f28fb4c73555e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 1 Mar 2018 13:41:02 -0500 Subject: [PATCH] Use the melee push pos update timer for rate limiting the pushes Also lowered the timer since it's limiting actual movement now --- zone/attack.cpp | 6 ++---- zone/mob.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 0979a705e..7648f566a 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3620,14 +3620,12 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const // update NPC stuff auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x), m_Position.y + (a->force * std::sin(a->hit_heading) + m_Delta.y), m_Position.z); - if (zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable. + if (position_update_melee_push_timer.Check() && zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable. if (IsNPC()) { // Is this adequate? Teleport(new_pos); - if (position_update_melee_push_timer.Check()) { - SendPositionUpdate(); - } + SendPositionUpdate(); } } else { diff --git a/zone/mob.cpp b/zone/mob.cpp index 3e9aff746..6c3808549 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -115,7 +115,7 @@ Mob::Mob(const char* in_name, fix_z_timer(300), fix_z_timer_engaged(100), attack_anim_timer(1000), - position_update_melee_push_timer(1000), + position_update_melee_push_timer(500), mHateListCleanup(6000) { targeted = 0;