From 3aae692ec33fc1e66453442bf19a10983804c18b Mon Sep 17 00:00:00 2001 From: ModoX Date: Tue, 4 Jun 2024 00:44:47 +0200 Subject: Core/Disables: Added DISABLE_TYPE_PHASE_AREA (#29997) --- src/server/game/Phasing/PhasingHandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/server/game/Phasing/PhasingHandler.cpp') 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()); -- cgit v1.2.3