[10563] Implement CMSG_PET_STOP_ATTACK.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
zergtmn 2010-09-30 21:02:03 +04:00 committed by VladimirMangos
parent 98f36e4652
commit f9fcf5e055
4 changed files with 29 additions and 2 deletions

View file

@ -272,6 +272,32 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
}
}
void WorldSession::HandlePetStopAttack(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received CMSG_PET_STOP_ATTACK");
ObjectGuid petGuid;
recv_data >> petGuid;
Unit* pet = GetPlayer()->GetMap()->GetUnit(petGuid); // pet or controlled creature/player
if (!pet)
{
sLog.outError("%s doesn't exist.", petGuid.GetString().c_str());
return;
}
if (GetPlayer()->GetGUID() != pet->GetCharmerOrOwnerGUID())
{
sLog.outError("HandlePetStopAttack: %s isn't charm/pet of %s.", petGuid.GetString().c_str(), GetPlayer()->GetObjectGuid().GetString().c_str());
return;
}
if (!pet->isAlive())
return;
pet->AttackStop();
}
void WorldSession::HandlePetNameQueryOpcode( WorldPacket & recv_data )
{
DETAIL_LOG( "HandlePetNameQuery. CMSG_PET_NAME_QUERY" );