Core/PacketIO: Handle CMSG_REQUEST_PET_INFO for more cases

Port From (https://github.com/TrinityCore/TrinityCore/commit/25e68fc5c20c2a331711ef74dbc6686d08e256ec)
This commit is contained in:
hondacrx
2022-02-17 16:38:09 -05:00
parent 266284247c
commit abf34c53b4
+21 -1
View File
@@ -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();
}
}
}
}
}