From 2a4d6523b14ddde7ac98a2a6cd897b4bb2e09aeb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 17 Sep 2017 10:12:41 -0500 Subject: [PATCH] Fix some zone entrance ghosting --- zone/entity.cpp | 2 +- zone/mob.h | 2 +- zone/waypoints.cpp | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 03b4ccf5a..a06a67092 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -648,7 +648,7 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue) parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0); - npc->FixZ(); + npc->FixZ(1); uint16 emoteid = npc->GetEmoteID(); if (emoteid != 0) diff --git a/zone/mob.h b/zone/mob.h index 270836f89..ccf92014b 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -951,7 +951,7 @@ public: void SendTo(float new_x, float new_y, float new_z); void SendToFixZ(float new_x, float new_y, float new_z); float GetZOffset() const; - void FixZ(); + void FixZ(int32 z_find_offset = 5); void NPCSpecialAttacks(const char* parse, int permtag, bool reset = true, bool remove = false); inline uint32 DontHealMeBefore() const { return pDontHealMeBefore; } inline uint32 DontBuffMeBefore() const { return pDontBuffMeBefore; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 4efefe198..9ed7c46f9 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -838,7 +838,8 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { } } -void Mob::FixZ() { +void Mob::FixZ(int32 z_find_offset /*= 5*/) +{ BenchTimer timer; timer.reset(); @@ -849,7 +850,7 @@ void Mob::FixZ() { (zone->HasWaterMap() && !zone->watermap->InWater(glm::vec3(m_Position)))) { /* 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); + float new_z = this->FindGroundZ(m_Position.x, m_Position.y, z_find_offset); new_z += this->GetZOffset(); auto duration = timer.elapsed();