[Z Clipping] Don't issue zclip adjustments when NPC is not moving (#3499)

This commit is contained in:
Chris Miles 2023-07-16 13:52:17 -05:00 committed by GitHub
parent ee45a28efe
commit 59537ae977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 &&