Core/Phases: backported 6.x phase fixes

This commit is contained in:
Rat committed 2015-04-02 20:32:09 +02:00
1 parent 1103f0889d
commit 037fd1b1bb
3 files changed
+29 -2

No files matched your search

+21 -2
View File
@@ -2861,10 +2861,10 @@ bool WorldObject::IsInPhase(WorldObject const* obj) const
if (_phases.empty() && obj->GetPhases().empty())
return true;
if (_phases.empty() && obj->IsInPhase(169))
if (_phases.empty() && obj->IsInPhase(DEFAULT_PHASE))
return true;
if (obj->GetPhases().empty() && IsInPhase(169))
if (obj->GetPhases().empty() && IsInPhase(DEFAULT_PHASE))
return true;
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->IsGameMaster())
@@ -3082,4 +3082,23 @@ void WorldObject::RebuildWorldMapAreaSwaps()
}
}
}
// Check all applied phases for world map area swaps
for (uint32 phaseId : _phases)
{
std::list<uint32>& swaps = sObjectMgr->GetPhaseTerrainSwaps(phaseId);
for (uint32 swap : swaps)
{
// add world map swaps for ANY map
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, swap);
if (sConditionMgr->IsObjectMeetToConditions(this, conditions))
{
for (uint32 map : sObjectMgr->GetTerrainWorldMaps(swap))
_worldMapAreaSwaps.insert(map);
}
}
}
}