Fix some zone entrance ghosting

This commit is contained in:
Akkadius 2017-09-17 10:12:41 -05:00
parent 6d8b96068d
commit 2a4d6523b1
3 changed files with 5 additions and 4 deletions

View File

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

View File

@ -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; }

View File

@ -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();