aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Phasing/PhasingHandler.cpp
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-06-04 00:44:47 +0200
committerGitHub <noreply@github.com>2024-06-04 00:44:47 +0200
commit3aae692ec33fc1e66453442bf19a10983804c18b (patch)
treecdde541662e6049b0b083ef733be31ee72a0f79e /src/server/game/Phasing/PhasingHandler.cpp
parent3fd967754388b7b859dbd8b954ec68a844e172f0 (diff)
Core/Disables: Added DISABLE_TYPE_PHASE_AREA (#29997)
Diffstat (limited to 'src/server/game/Phasing/PhasingHandler.cpp')
-rw-r--r--src/server/game/Phasing/PhasingHandler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/game/Phasing/PhasingHandler.cpp b/src/server/game/Phasing/PhasingHandler.cpp
index 9c11eb1c56e..d3f187f4a69 100644
--- a/src/server/game/Phasing/PhasingHandler.cpp
+++ b/src/server/game/Phasing/PhasingHandler.cpp
@@ -20,6 +20,7 @@
#include "ConditionMgr.h"
#include "Creature.h"
#include "DB2Stores.h"
+#include "DisableMgr.h"
#include "Language.h"
#include "Map.h"
#include "MiscPackets.h"
@@ -318,6 +319,9 @@ void PhasingHandler::OnAreaChange(WorldObject* object)
continue;
uint32 phaseId = phaseArea.PhaseInfo->Id;
+ if (DisableMgr::IsDisabledFor(DISABLE_TYPE_PHASE_AREA, phaseId, object))
+ continue;
+
if (sConditionMgr->IsObjectMeetToConditions(srcInfo, phaseArea.Conditions))
phaseShift.AddPhase(phaseId, GetPhaseFlags(phaseId), &phaseArea.Conditions);
else
@@ -388,7 +392,7 @@ bool PhasingHandler::OnConditionChange(WorldObject* object, bool updateVisibilit
for (auto itr = suppressedPhaseShift.Phases.begin(); itr != suppressedPhaseShift.Phases.end();)
{
- if (sConditionMgr->IsObjectMeetToConditions(srcInfo, *ASSERT_NOTNULL(itr->AreaConditions)))
+ if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_PHASE_AREA, itr->Id, object) && sConditionMgr->IsObjectMeetToConditions(srcInfo, *ASSERT_NOTNULL(itr->AreaConditions)))
{
changed = phaseShift.AddPhase(itr->Id, itr->Flags, itr->AreaConditions, itr->References) || changed;
suppressedPhaseShift.ModifyPhasesReferences(itr, -itr->References);
@@ -642,6 +646,8 @@ void PhasingHandler::PrintToChat(ChatHandler* chat, WorldObject const* target)
phases << ' ' << '(' << cosmetic << ')';
if (phase.Flags.HasFlag(PhaseFlags::Personal))
phases << ' ' << '(' << personal << ')';
+ if (DisableMgr::IsDisabledFor(DISABLE_TYPE_PHASE_AREA, phase.Id, nullptr))
+ phases << " (Disabled)";
}
chat->PSendSysMessage(LANG_PHASESHIFT_PHASES, phases.str().c_str());