From cb2a777efc2ec2cf237eb07dd2080c76d50542a3 Mon Sep 17 00:00:00 2001 From: killerwife Date: Thu, 28 Nov 2024 22:33:09 +0100 Subject: [PATCH] Spell: Make phase change apply to root vehicle and change bg flag drop hack --- src/game/Entities/Player.cpp | 7 +++---- src/game/Spells/SpellAuras.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index 875029ca043..3873133d79c 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -21268,11 +21268,10 @@ void Player::SetPhaseMask(uint32 newPhaseMask, bool update) if (IsGameMaster()) newPhaseMask = static_cast(PHASEMASK_ANYWHERE); - // phase auras normally not expected at BG but anyway better check - if (BattleGround* bg = GetBattleGround()) - bg->HandlePlayerDroppedFlag(this); - Unit::SetPhaseMask(newPhaseMask, update); + + if (Unit* vehicle = const_cast(FindRootVehicle())) + vehicle->SetPhaseMask(newPhaseMask, update); GetSession()->SendSetPhaseShift(GetPhaseMask()); } diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index d4bfbdb36d6..ad8e37b1ece 100755 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -9455,6 +9455,13 @@ void Aura::HandlePhase(bool apply, bool Real) newPhase |= (*itr)->GetMiscValue(); target->SetPhaseMask(newPhase ? newPhase : uint32(PHASEMASK_NORMAL), true); + + if (apply) + { + // drop flag at invisibiliy in bg + target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_STEALTH_INVIS_CANCELS); + } + // no-phase is also phase state so same code for apply and remove if (target->GetTypeId() == TYPEID_PLAYER) {