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

+ vehicle
+ charm
+ possession

from 87c6cc19e5
This commit is contained in:
NoName
2020-04-05 15:53:23 +03:00
committed by GitHub
parent d5f5734241
commit fbcd244b2f

View File

@@ -904,5 +904,21 @@ void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recvData)
void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recvPacket*/)
{
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->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && charm->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED))
_player->VehicleSpellInitialize();
// Packet sent when player has a charmed unit
else
_player->CharmSpellInitialize();
}
}