Core/Pets: Improved pet despawn behavior when mounting

* Pets will now only be despawned when starting to fly
* Fixed crash when summoning a pet that is different than the one that was despawned by flying

Closes #29303
This commit is contained in:
Shauren
2023-09-10 11:54:09 +02:00
parent edb103eadb
commit a667d723bf
11 changed files with 96 additions and 39 deletions

View File

@@ -401,6 +401,9 @@ void WorldSession::HandleMovementOpcode(OpcodeClient opcode, MovementInfo& movem
if (opcode == CMSG_MOVE_FALL_LAND || opcode == CMSG_MOVE_START_SWIM || opcode == CMSG_MOVE_SET_FLY)
mover->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::LandingOrFlight); // Parachutes
if (opcode == CMSG_MOVE_SET_FLY || opcode == CMSG_MOVE_SET_ADV_FLY)
_player->UnsummonPetTemporaryIfAny(); // always do the pet removal on current client activeplayer only
/* process position-change */
movementInfo.guid = mover->GetGUID();
movementInfo.time = AdjustClientMovementTime(movementInfo.time);