Core/Phase: phase_area table now support even parent area (known as zone)

Closes https://github.com/TrinityCore/TrinityCore/issues/17025
This commit is contained in:
MitchesD
2016-05-18 20:06:47 +02:00
parent 042e1ae266
commit f636141345
6 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -2809,16 +2809,16 @@ bool WorldObject::HasInPhaseList(uint32 phase)
// Updates Area based phases, does not remove phases from auras
// Phases from gm commands are not taken into calculations, they can be lost!!
void WorldObject::UpdateAreaPhase()
void WorldObject::UpdateAreaAndZonePhase()
{
bool updateNeeded = false;
PhaseInfo const& phases = sObjectMgr->GetAreaPhases();
PhaseInfo const& phases = sObjectMgr->GetAreaAndZonePhases();
for (PhaseInfo::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
{
uint32 areaId = itr->first;
uint32 areaOrZoneId = itr->first;
for (PhaseInfoStruct const& phase : itr->second)
{
if (areaId == GetAreaId())
if (areaOrZoneId == GetAreaId() || areaOrZoneId == GetZoneId())
{
if (sConditionMgr->IsObjectMeetToConditions(this, phase.Conditions))
{