mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Use the melee push pos update timer for rate limiting the pushes
Also lowered the timer since it's limiting actual movement now
This commit is contained in:
parent
8e4aff391e
commit
7edc891605
@ -3620,14 +3620,12 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
|||||||
// update NPC stuff
|
// update NPC stuff
|
||||||
auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x),
|
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);
|
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()) {
|
if (IsNPC()) {
|
||||||
// Is this adequate?
|
// Is this adequate?
|
||||||
|
|
||||||
Teleport(new_pos);
|
Teleport(new_pos);
|
||||||
if (position_update_melee_push_timer.Check()) {
|
SendPositionUpdate();
|
||||||
SendPositionUpdate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -115,7 +115,7 @@ Mob::Mob(const char* in_name,
|
|||||||
fix_z_timer(300),
|
fix_z_timer(300),
|
||||||
fix_z_timer_engaged(100),
|
fix_z_timer_engaged(100),
|
||||||
attack_anim_timer(1000),
|
attack_anim_timer(1000),
|
||||||
position_update_melee_push_timer(1000),
|
position_update_melee_push_timer(500),
|
||||||
mHateListCleanup(6000)
|
mHateListCleanup(6000)
|
||||||
{
|
{
|
||||||
targeted = 0;
|
targeted = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user