aboutsummaryrefslogtreecommitdiff
path: root/src/game/PetHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/PetHandler.cpp')
-rw-r--r--src/game/PetHandler.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index abfb964237a..34e6845762b 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -32,6 +32,28 @@
#include "Pet.h"
#include "World.h"
+void WorldSession::HandleDismissCritter(WorldPacket &recv_data)
+{
+ uint64 guid;
+ recv_data >> guid;
+
+ sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID %u", guid);
+
+ Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
+
+ if (!pet)
+ {
+ sLog.outError("Vanitypet %u does not exist", uint32(GUID_LOPART(guid)));
+ return;
+ }
+
+ if (_player->GetCritterGUID() == pet->GetGUID())
+ {
+ if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isSummon())
+ pet->ToTempSummon()->UnSummon();
+ }
+}
+
void WorldSession::HandlePetAction(WorldPacket & recv_data)
{
uint64 guid1;