[Pathing] Improvements to z-clipping, z-recovery and z-calculations (#2975)

* zclip adjustments

* Remove debug
This commit is contained in:
Chris Miles
2023-02-21 10:24:25 -06:00
committed by GitHub
parent 33bb5aa8e5
commit 1e50f19f7e
4 changed files with 24 additions and 15 deletions
+8
View File
@@ -1071,6 +1071,14 @@ void Mob::AI_Process() {
}
if (engaged) {
if (IsNPC() && m_z_clip_check_timer.Check()) {
auto t = GetTarget();
if (t && DistanceNoZ(GetPosition(), t->GetPosition()) < 75 && std::abs(GetPosition().z - t->GetPosition().z) > 15 && !CheckLosFN(t)) {
GMMove(t->GetPosition().x, t->GetPosition().y, t->GetPosition().z, t->GetPosition().w);
FaceTarget(t);
}
}
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);