mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-20 14:51:34 -04:00
* Properly dismiss vanitypets (implements use of CMSG_DISMISS_CRITTER)
Some small code cleanups --HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user