mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: Handle CMSG_REQUEST_PET_INFO for more cases (#24364)
+ vehicle + charm + possession from87c6cc19e5(cherry picked from commitfbcd244b2f)
This commit is contained in:
@@ -764,5 +764,21 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec
|
||||
|
||||
void WorldSession::HandleRequestPetInfo(WorldPackets::Pet::RequestPetInfo& /*requestPetInfo*/)
|
||||
{
|
||||
GetPlayer()->PetSpellInitialize();
|
||||
// Handle the packet CMSG_REQUEST_PET_INFO - sent when player does ingame /reload command
|
||||
|
||||
// Packet sent when player has a pet
|
||||
if (_player->GetPet())
|
||||
_player->PetSpellInitialize();
|
||||
else if (Unit* charm = _player->GetCharmed())
|
||||
{
|
||||
// Packet sent when player has a possessed unit
|
||||
if (charm->HasUnitState(UNIT_STATE_POSSESSED))
|
||||
_player->PossessSpellInitialize();
|
||||
// Packet sent when player controlling a vehicle
|
||||
else if (charm->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && charm->HasUnitFlag(UNIT_FLAG_POSSESSED))
|
||||
_player->VehicleSpellInitialize();
|
||||
// Packet sent when player has a charmed unit
|
||||
else
|
||||
_player->CharmSpellInitialize();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user