Core/Objects: SetZoneScript will now use map zone coordinates instead of using the cached zone id

This commit is contained in:
Ovahlord committed 2019-02-25 00:39:28 +01:00
1 parent 0c358c9a0b
commit 4474655779
2 files changed
+6 -4

No files matched your search

+4 -2
View File
@@ -2168,10 +2168,12 @@ void WorldObject::SetZoneScript()
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
else if (!map->IsBattlegroundOrArena())
{
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
uint32 zoneId = GetMap()->GetZoneId(GetPhaseShift(), GetPosition());
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneId))
m_zoneScript = bf;
else
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(zoneId);
}
}
}