From 59537ae977c5ffab0da2859f6415c4caf297a3f6 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sun, 16 Jul 2023 13:52:17 -0500 Subject: [PATCH] [Z Clipping] Don't issue zclip adjustments when NPC is not moving (#3499) --- zone/mob_ai.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index c9a9c9aad..91f204312 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1071,8 +1071,9 @@ void Mob::AI_Process() { if (engaged) { if (IsNPC() && m_z_clip_check_timer.Check()) { - auto t = GetTarget(); - if (t) { + bool is_moving = IsMoving() && !(IsRooted() || IsStunned() || IsMezzed()); + auto t = GetTarget(); + if (is_moving && t) { float self_z = GetZ() - GetZOffset(); float target_z = t->GetPosition().z - t->GetZOffset(); if (DistanceNoZ(GetPosition(), t->GetPosition()) < 75 &&