aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/PhaseMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Maps/PhaseMgr.cpp')
-rw-r--r--src/server/game/Maps/PhaseMgr.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp
index 0314a9605ba..87a7bc434ff 100644
--- a/src/server/game/Maps/PhaseMgr.cpp
+++ b/src/server/game/Maps/PhaseMgr.cpp
@@ -17,6 +17,7 @@
#include "PhaseMgr.h"
#include "Chat.h"
+#include "Group.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
@@ -36,7 +37,10 @@ void PhaseMgr::Update()
return;
if (_UpdateFlags & PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED)
+ {
phaseData.SendPhaseshiftToPlayer();
+ player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PHASE);
+ }
if (_UpdateFlags & PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED)
phaseData.SendPhaseMaskToPlayer();
@@ -281,6 +285,18 @@ void PhaseData::SendPhaseshiftToPlayer()
player->GetSession()->SendSetPhaseShift(phaseIds, terrainswaps);
}
+void PhaseData::GetActivePhases(std::set<uint32>& phases) const
+{
+ for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr)
+ if (itr->second.phaseId)
+ phases.insert(itr->second.phaseId);
+
+ // Phase Definitions
+ for (std::list<PhaseDefinition const*>::const_iterator itr = activePhaseDefinitions.begin(); itr != activePhaseDefinitions.end(); ++itr)
+ if ((*itr)->phaseId)
+ phases.insert((*itr)->phaseId);
+}
+
void PhaseData::AddPhaseDefinition(PhaseDefinition const* phaseDefinition)
{
if (phaseDefinition->IsOverwritingExistingPhases())
@@ -380,3 +396,8 @@ bool PhaseMgr::IsConditionTypeSupported(ConditionTypes conditionType)
return false;
}
}
+
+void PhaseMgr::GetActivePhases(std::set<uint32>& phases) const
+{
+ phaseData.GetActivePhases(phases);
+}