diff --git a/zone/aggro.cpp b/zone/aggro.cpp index d73b96f6f..91d14498f 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -931,7 +931,9 @@ bool Mob::CombatRange(Mob* other) if (size_mod > 10000) size_mod = size_mod / 7; - float _DistNoRoot = DistanceSquared(m_Position, other->GetPosition()); + float _DistNoRoot = DistanceSquaredNoZ(m_Position, other->GetPosition()); + float _zDist = m_Position.z - other->GetZ(); + _zDist *= _zDist; if (GetSpecialAbility(NPC_CHASE_DISTANCE)){ @@ -960,6 +962,11 @@ bool Mob::CombatRange(Mob* other) if (_DistNoRoot <= size_mod) { + //A hack to kill an exploit till we get something better. + if (flymode == 0 && _zDist > 500 && !CheckLastLosState()) { + return false; + } + return true; } return false; diff --git a/zone/pathfinder_nav_mesh.cpp b/zone/pathfinder_nav_mesh.cpp index ea6de52bb..fb2d23e9b 100644 --- a/zone/pathfinder_nav_mesh.cpp +++ b/zone/pathfinder_nav_mesh.cpp @@ -59,12 +59,12 @@ IPathfinder::IPath PathfinderNavmesh::FindRoute(const glm::vec3 &start, const gl filter.setAreaCost(6, 1.5f); //Ice filter.setAreaCost(7, 3.0f); //V Water (Frigid Water) filter.setAreaCost(8, 1.0f); //General Area - filter.setAreaCost(9, 1.0f); //Portal - filter.setAreaCost(10, 0.5f); //Prefer + filter.setAreaCost(9, 0.1f); //Portal + filter.setAreaCost(10, 0.1f); //Prefer dtPolyRef start_ref; dtPolyRef end_ref; - glm::vec3 ext(15.0f, 100.0f, 15.0f); + glm::vec3 ext(5.0f, 100.0f, 5.0f); m_impl->query->findNearestPoly(¤t_location[0], &ext[0], &filter, &start_ref, 0); m_impl->query->findNearestPoly(&dest_location[0], &ext[0], &filter, &end_ref, 0);