From f7cc23d41553c6a3c02610871abd477baae57ef4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 16 Jul 2017 03:21:13 -0500 Subject: [PATCH] Cracked the code on FixZ offsets --- zone/waypoints.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index d1581a21c..15ab630ca 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -849,6 +849,7 @@ void Mob::FixZ() { { /* Any more than 5 in the offset makes NPC's hop/snap to ceiling in small corridors */ float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 5); + new_z += (this->GetSize() / 1.55); auto duration = timer.elapsed(); @@ -864,7 +865,7 @@ void Mob::FixZ() { duration ); - if ((new_z > -2000) && std::abs(m_Position.z - new_z) < 35) { + if ((new_z > -2000) && new_z != -999999) { if (RuleB(Map, MobZVisualDebug)) this->SendAppearanceEffect(78, 0, 0, 0, 0);