Skip to content

Commit

Permalink
Always interrupt channeled spell on teleport.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Dec 5, 2023
1 parent 2c4ec61 commit a510ea4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2270,9 +2270,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
return false;
}

// preparing unsummon pet if lost (we must get pet before teleportation or will not find it later)
Pet* pet = GetPet();

MapEntry const* mEntry = sMapStorage.LookupEntry<MapEntry>(mapid);

// don't let enter battlegrounds without assigned battleground id (for example through areatrigger)...
Expand Down Expand Up @@ -2304,6 +2301,13 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (!(options & TELE_TO_NOT_LEAVE_TRANSPORT) || !m_transport)
m_movementInfo.RemoveMovementFlag(MOVEFLAG_ONTRANSPORT);

// Interrupt channeled spells before teleport.
// This fixes pet spells being lost if channeling Eye of Kilrogg during teleport.
InterruptSpellsWithChannelFlags(AURA_INTERRUPT_MOVING_CANCELS | AURA_INTERRUPT_TURNING_CANCELS);

// Preparing unsummon pet if lost (we must get pet before teleportation or will not find it later).
Pet* pet = GetPet();

// Near teleport, let it happen immediately since we remain in the same map
if ((GetMapId() == mapid) && (!m_transport) && !(options & TELE_TO_FORCE_MAP_CHANGE))
{
Expand Down

0 comments on commit a510ea4

Please sign in to comment.