Core/PacketIO: Handle CMSG_REQUEST_PET_INFO for more cases
Port From (https://github.com/TrinityCore/TrinityCore/commit/25e68fc5c20c2a331711ef74dbc6686d08e256ec)
This commit is contained in:
@@ -758,7 +758,27 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.RequestPetInfo)]
|
||||
void HandleRequestPetInfo(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
|
||||
{
|
||||
Unit charm = _player.GetCharmed();
|
||||
if (charm != null)
|
||||
{
|
||||
// Packet sent when player has a possessed unit
|
||||
if (charm.HasUnitState(UnitState.Possessed))
|
||||
_player.PossessSpellInitialize();
|
||||
// Packet sent when player controlling a vehicle
|
||||
else if (charm.HasUnitFlag(UnitFlags.PlayerControlled) && charm.HasUnitFlag(UnitFlags.Possessed))
|
||||
_player.VehicleSpellInitialize();
|
||||
// Packet sent when player has a charmed unit
|
||||
else
|
||||
_player.CharmSpellInitialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user