mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Lets ignore Z on distance hate removal until pathing doesn't suck
This commit is contained in:
parent
6716e580f3
commit
13ad5e4b46
@ -657,6 +657,8 @@ void HateList::RemoveStaleEntries(int time_ms, float dist)
|
||||
|
||||
auto cur_time = Timer::GetCurrentTime();
|
||||
|
||||
auto dist2 = dist * dist;
|
||||
|
||||
while (it != list.end()) {
|
||||
auto m = (*it)->entity_on_hatelist;
|
||||
if (m) {
|
||||
@ -665,7 +667,7 @@ void HateList::RemoveStaleEntries(int time_ms, float dist)
|
||||
if (cur_time - (*it)->last_modified > time_ms)
|
||||
remove = true;
|
||||
|
||||
if (!remove && hate_owner->CalculateDistance(m->GetX(), m->GetY(), m->GetZ()) > dist) {
|
||||
if (!remove && DistanceSquaredNoZ(hate_owner->GetPosition(), m->GetPosition()) > dist2) {
|
||||
(*it)->oor_count++;
|
||||
if ((*it)->oor_count == 2)
|
||||
remove = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user