Skip to content

Commit

Permalink
Spell: Make phase change apply to root vehicle and change bg flag dro…
Browse files Browse the repository at this point in the history
…p hack
  • Loading branch information
killerwife committed Nov 28, 2024
1 parent 28132e8 commit cb2a777
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21268,11 +21268,10 @@ void Player::SetPhaseMask(uint32 newPhaseMask, bool update)
if (IsGameMaster())
newPhaseMask = static_cast<uint32>(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<Unit*>(FindRootVehicle()))
vehicle->SetPhaseMask(newPhaseMask, update);
GetSession()->SendSetPhaseShift(GetPhaseMask());
}

Expand Down
7 changes: 7 additions & 0 deletions src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit cb2a777

Please sign in to comment.