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
from 87c6cc19e5
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user