Core/PacketIO: Handle CMSG_REQUEST_PET_INFO for more cases (#24364)

+ vehicle
+ charm
+ possession

from 87c6cc19e5

(cherry picked from commit fbcd244b2f)
This commit is contained in:
NoName
2020-04-05 15:53:23 +03:00
committed by Shauren
parent a95c836b3b
commit 25e68fc5c2

View File

@@ -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();
}
}